diff options
| author | Vexu <git@vexu.eu> | 2020-07-17 20:16:23 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2020-07-18 16:45:07 +0300 |
| commit | 596ca6cf70cf43c27e31bbcfc36bcdc70b13897a (patch) | |
| tree | 1f6915d289cf77ac70d7a7f23ca7f2b6f73e4aa6 /test/stage1 | |
| parent | 78962eeeda07d613ebdfd239082268a6702c19db (diff) | |
| download | zig-596ca6cf70cf43c27e31bbcfc36bcdc70b13897a.tar.gz zig-596ca6cf70cf43c27e31bbcfc36bcdc70b13897a.zip | |
allow non-pointer extern opaque variables
Diffstat (limited to 'test/stage1')
| -rw-r--r-- | test/stage1/behavior/misc.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/stage1/behavior/misc.zig b/test/stage1/behavior/misc.zig index 021dbe5602..57a9ba2576 100644 --- a/test/stage1/behavior/misc.zig +++ b/test/stage1/behavior/misc.zig @@ -713,3 +713,10 @@ test "auto created variables have correct alignment" { expect(S.foo("\x7a\x7a\x7a\x7a") == 0x7a7a7a7a); comptime expect(S.foo("\x7a\x7a\x7a\x7a") == 0x7a7a7a7a); } + +extern var opaque_extern_var: @Type(.Opaque); +var var_to_export: u32 = 42; +test "extern variable with non-pointer opaque type" { + @export(var_to_export, .{ .name = "opaque_extern_var" }); + expect(@ptrCast(*align(1) u32, &opaque_extern_var).* == 42); +} |
