From 5258e13d0b5ed1fb201579115d618728ab0b69c0 Mon Sep 17 00:00:00 2001 From: Corey Richardson Date: Thu, 27 Mar 2014 07:54:41 -0400 Subject: [PATCH] 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. --- src/test/run-pass/out-of-stack.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/run-pass/out-of-stack.rs b/src/test/run-pass/out-of-stack.rs index 9344c29d5ca..d1daa1e365e 100644 --- a/src/test/run-pass/out-of-stack.rs +++ b/src/test/run-pass/out-of-stack.rs @@ -28,6 +28,7 @@ fn silent_recurse() { fn loud_recurse() { println!("hello!"); loud_recurse(); + black_box(()); // don't optimize this into a tail call. please. } fn main() {