diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-10-28 17:05:17 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-10-28 17:05:17 -0700 |
| commit | c59ee3157f5a7fb5c6110422ea8215601285ea28 (patch) | |
| tree | 6c241c1adb150f18ff109d5e14aba7d46bf90cb9 /test/behavior/if.zig | |
| parent | 9ed955e5ca755ddfa7ee4cb3c34f6373cb1bf6a8 (diff) | |
| download | zig-c59ee3157f5a7fb5c6110422ea8215601285ea28.tar.gz zig-c59ee3157f5a7fb5c6110422ea8215601285ea28.zip | |
C backend: fix ptrtoint and wrap_errunion_err
Diffstat (limited to 'test/behavior/if.zig')
| -rw-r--r-- | test/behavior/if.zig | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/test/behavior/if.zig b/test/behavior/if.zig index e907f288de..a1f722d827 100644 --- a/test/behavior/if.zig +++ b/test/behavior/if.zig @@ -73,18 +73,3 @@ test "const result loc, runtime if cond, else unreachable" { const x = if (t) Num.Two else unreachable; try expect(x == .Two); } - -test "if copies its payload" { - const S = struct { - fn doTheTest() !void { - var tmp: ?i32 = 10; - if (tmp) |value| { - // Modify the original variable - tmp = null; - try expect(value == 10); - } else unreachable; - } - }; - try S.doTheTest(); - comptime try S.doTheTest(); -} |
