Skip to content

Commit 5258e13

Browse files
committed
test/run-pass/out-of-stack: prevent tco
We really do *not* want TCO to kick in. If it does, we'll never blow the stack, and never trigger the condition the test is checking for. To that end, do a meaningless alloc that serves only to get a destructor to run. The addition of nocapture/noalias seems to have let LLVM do more TCO, which hurt this testcase.
1 parent b8ed136 commit 5258e13

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/test/run-pass/out-of-stack.rs

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ fn silent_recurse() {
2828
fn loud_recurse() {
2929
println!("hello!");
3030
loud_recurse();
31+
black_box(()); // don't optimize this into a tail call. please.
3132
}
3233

3334
fn main() {

0 commit comments

Comments
 (0)