]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/loop_test.rs
Auto merge of #107667 - cjgillot:no-on-hit, r=lcnr,Zoxc
[rust.git] / tests / mir-opt / loop_test.rs
1 // compile-flags: -Z identify_regions
2
3 // Tests to make sure we correctly generate falseUnwind edges in loops
4
5 // EMIT_MIR loop_test.main.SimplifyCfg-promote-consts.after.mir
6 fn main() {
7     // Exit early at runtime. Since only care about the generated MIR
8     // and not the runtime behavior (which is exercised by other tests)
9     // we just bail early. Without this the test just loops infinitely.
10     if true {
11         return;
12     }
13     loop {
14         let x = 1;
15         continue;
16     }
17 }