diff options
| author | Daniele Cocca <daniele.cocca@gmail.com> | 2022-04-30 07:34:21 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-04-30 13:29:21 -0400 |
| commit | d127c1d59ebf19e5ffaedece99a39f69712683b0 (patch) | |
| tree | a0eeee42fefce1fba094ab8ce6851452aba561ac /test/behavior | |
| parent | 032c722d2019a475362c0ae01241a80417bdd8a2 (diff) | |
| download | zig-d127c1d59ebf19e5ffaedece99a39f69712683b0.tar.gz zig-d127c1d59ebf19e5ffaedece99a39f69712683b0.zip | |
CBE: handle returning `undefined` for ErrorUnion
Just like for Struct in 8238d4b33585a715c58ab559cd001dd3ea1db55b, in the
case of ErrorUnion struct we need to return a compound literal "(T){...}"
instead of just "{}", which is invalid code when used in e.g. a "return"
expression.
Diffstat (limited to 'test/behavior')
| -rw-r--r-- | test/behavior/sizeof_and_typeof.zig | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/test/behavior/sizeof_and_typeof.zig b/test/behavior/sizeof_and_typeof.zig index 5db56243af..3dd786d1f7 100644 --- a/test/behavior/sizeof_and_typeof.zig +++ b/test/behavior/sizeof_and_typeof.zig @@ -187,7 +187,6 @@ test "@sizeOf(T) == 0 doesn't force resolving struct size" { test "@TypeOf() has no runtime side effects" { if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; const S = struct { fn foo(comptime T: type, ptr: *T) T { ptr.* += 1; @@ -203,7 +202,6 @@ test "@TypeOf() has no runtime side effects" { test "branching logic inside @TypeOf" { if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; const S = struct { var data: i32 = 0; fn foo() anyerror!i32 { |
