diff options
Diffstat (limited to 'test/behavior/while.zig')
| -rw-r--r-- | test/behavior/while.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/behavior/while.zig b/test/behavior/while.zig index 5bbcb153c5..71f1d253e9 100644 --- a/test/behavior/while.zig +++ b/test/behavior/while.zig @@ -1,6 +1,7 @@ const std = @import("std"); const builtin = @import("builtin"); const expect = std.testing.expect; +const assert = std.debug.assert; test "while loop" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; @@ -326,3 +327,12 @@ test "while error 2 break statements and an else" { try S.entry(true, false); comptime try S.entry(true, false); } + +test "continue inline while loop" { + comptime var i = 0; + inline while (i < 10) : (i += 1) { + if (i < 5) continue; + break; + } + comptime assert(i == 5); +} |
