| ... | @@ -287,6 +287,28 @@ export fn _start() -> unreachable { | ... | @@ -287,6 +287,28 @@ export fn _start() -> unreachable { |
| 287 | if (!true) { puts("BAD 2"); } | 287 | if (!true) { puts("BAD 2"); } |
| 288 | if (!false) { puts("OK 2"); } | 288 | if (!false) { puts("OK 2"); } |
| 289 | exit(0); | 289 | exit(0); |
| | 290 | } |
| | 291 | )SOURCE", "OK 1\nOK 2\n"); |
| | 292 | |
| | 293 | add_simple_case("separate block scopes", R"SOURCE( |
| | 294 | #link("c") |
| | 295 | extern { |
| | 296 | fn puts(s: *const u8) -> i32; |
| | 297 | fn exit(code: i32) -> unreachable; |
| | 298 | } |
| | 299 | |
| | 300 | export fn _start() -> unreachable { |
| | 301 | if (true) { |
| | 302 | let no_conflict = 5; |
| | 303 | if (no_conflict == 5) { puts("OK 1"); } |
| | 304 | } |
| | 305 | |
| | 306 | let c = { |
| | 307 | let no_conflict = 10; |
| | 308 | no_conflict |
| | 309 | }; |
| | 310 | if (c == 10) { puts("OK 2"); } |
| | 311 | exit(0); |
| 290 | } | 312 | } |
| 291 | )SOURCE", "OK 1\nOK 2\n"); | 313 | )SOURCE", "OK 1\nOK 2\n"); |
| 292 | } | 314 | } |