diff --git a/test/run_tests.cpp b/test/run_tests.cpp index 875e2b94ff..3f5dd6d69c 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -287,6 +287,28 @@ export fn _start() -> unreachable { if (!true) { puts("BAD 2"); } if (!false) { puts("OK 2"); } exit(0); +} + )SOURCE", "OK 1\nOK 2\n"); + + add_simple_case("separate block scopes", R"SOURCE( +#link("c") +extern { + fn puts(s: *const u8) -> i32; + fn exit(code: i32) -> unreachable; +} + +export fn _start() -> unreachable { + if (true) { + let no_conflict = 5; + if (no_conflict == 5) { puts("OK 1"); } + } + + let c = { + let no_conflict = 10; + no_conflict + }; + if (c == 10) { puts("OK 2"); } + exit(0); } )SOURCE", "OK 1\nOK 2\n"); }