aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/basic.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-03-09 17:12:40 +0200
committerVeikka Tuominen <git@vexu.eu>2022-03-09 17:12:40 +0200
commit01b454f8515312531ff0c70985203f9aecb022db (patch)
treee5ac6ea062d051f5b062d3d11643d17e6dfd58ff /test/behavior/basic.zig
parentbb1fa0bdbd7235308362528e5c1ca408681064e9 (diff)
downloadzig-01b454f8515312531ff0c70985203f9aecb022db.tar.gz
zig-01b454f8515312531ff0c70985203f9aecb022db.zip
AstGen: ensure lableld block implicitly ends in a break
Diffstat (limited to 'test/behavior/basic.zig')
-rw-r--r--test/behavior/basic.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/behavior/basic.zig b/test/behavior/basic.zig
index 1ed7ea9faf..25a302398b 100644
--- a/test/behavior/basic.zig
+++ b/test/behavior/basic.zig
@@ -846,3 +846,10 @@ test "discarding the result of various expressions" {
_ = while (S.bar()) |some| break some else {};
_ = for ("foo") |char| break char else {};
}
+
+test "labeled block implicitly ends in a break" {
+ var a = false;
+ blk: {
+ if (a) break :blk;
+ }
+}