mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
make it a behavior test instead
It's important to check for correct runtime behavior, rather than only checking that the compiler does not crash.
This commit is contained in:
parent
29ac68b253
commit
b993728f10
2 changed files with 10 additions and 12 deletions
|
|
@ -216,3 +216,13 @@ test "switch loop with pointer capture" {
|
||||||
try S.doTheTest();
|
try S.doTheTest();
|
||||||
try comptime S.doTheTest();
|
try comptime S.doTheTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "unanalyzed continue with operand" {
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||||
|
|
||||||
|
@setRuntimeSafety(false);
|
||||||
|
label: switch (false) {
|
||||||
|
false => if (false) continue :label true,
|
||||||
|
true => {},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
// https://github.com/ziglang/zig/issues/24323
|
|
||||||
|
|
||||||
export fn f() void {
|
|
||||||
const x: u32 = 0;
|
|
||||||
sw: switch (x) {
|
|
||||||
else => if (false) continue :sw undefined,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// compile
|
|
||||||
// backend=stage2,llvm
|
|
||||||
// target=native
|
|
||||||
Loading…
Add table
Reference in a new issue