mirror of
https://github.com/ziglang/zig.git
synced 2026-02-15 13:58:27 +00:00
test for separate scopes not colliding
This commit is contained in:
parent
09a78d6235
commit
137fe99258
@ -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");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user