Skip to content

Commit b865a76

Browse files
add regression test
1 parent 8e11199 commit b865a76

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// build-pass
2+
// compile-flags: -Copt-level=0
3+
4+
// Regression test for #88043: LLVM crash when the RemoveZsts mir-opt pass is enabled.
5+
// We should not see the error:
6+
// `Basic Block in function '_ZN4main10take_until17h0067b8a660429bc9E' does not have terminator!`
7+
8+
fn bump() -> Option<usize> {
9+
unreachable!()
10+
}
11+
12+
fn take_until(terminate: impl Fn() -> bool) {
13+
loop {
14+
if terminate() {
15+
return;
16+
} else {
17+
bump();
18+
}
19+
}
20+
}
21+
22+
// CHECK-LABEL: @main
23+
fn main() {
24+
take_until(|| true);
25+
}

0 commit comments

Comments
 (0)