]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/non-terminate/infinite-loop-2.rs
Rollup merge of #90202 - matthewjasper:xcrate-hygiene, r=petrochenkov
[rust.git] / src / test / codegen / non-terminate / infinite-loop-2.rs
1 // compile-flags: -C opt-level=3
2
3 #![crate_type = "lib"]
4
5 fn infinite_loop() -> u8 {
6     let i = 2;
7     while i > 1 {}
8     1
9 }
10
11 // CHECK-LABEL: @test
12 #[no_mangle]
13 fn test() -> u8 {
14     // CHECK-NOT: unreachable
15     // CHECK: br label %{{.+}}
16     // CHECK-NOT: unreachable
17     let x = infinite_loop();
18     x
19 }