about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-08-11 22:11:34 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-08-11 22:42:20 -0700
commit29eae0eceb043bff108950dd3b2cf5a4c0fb30a2 (patch)
treeda180e3768c031288d69f7f160055f8b8c645d7c
parentb5b8f1bd90f109a4e4f8ffa7b01a6b91cc2c77d6 (diff)
parent689d13dde95cdcfa1353e5382dee49c0acf1ded4 (diff)
downloadrust-29eae0eceb043bff108950dd3b2cf5a4c0fb30a2.tar.gz
rust-29eae0eceb043bff108950dd3b2cf5a4c0fb30a2.zip
rollup merge of #27650: dotdash/backtrace_test
LLVM might perform tail merging on the calls that initiate the unwinding
process which breaks debuginfo and therefore this test. Since tail
merging is guaranteed to break debuginfo, it should be disabled for this
test.

This allows us to restore a testcase that I had to remove earlier
because of the same problem, because back then I didn't realize that
disabling tail merging was an option.

cc #27619
-rw-r--r--src/test/run-pass/backtrace-debuginfo.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/test/run-pass/backtrace-debuginfo.rs b/src/test/run-pass/backtrace-debuginfo.rs
index 8f41c68b047..f889e381dc4 100644
--- a/src/test/run-pass/backtrace-debuginfo.rs
+++ b/src/test/run-pass/backtrace-debuginfo.rs
@@ -8,7 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags:-g
+// We disable tail merging here because it can't preserve debuginfo and thus
+// potentially breaks the backtraces. Also, subtle changes can decide whether
+// tail merging suceeds, so the test might work today but fail tomorrow due to a
+// seemingly completely unrelated change.
+// Unfortunately, LLVM has no "disable" option for this, so we have to set
+// "enable" to 0 instead.
+// compile-flags:-g -Cllvm-args=-enable-tail-merge=0
 // ignore-pretty as this critically relies on line numbers
 
 use std::io;
@@ -97,6 +103,10 @@ fn inner_inlined(counter: &mut i32, main_pos: Pos, outer_pos: Pos) {
     let inner_pos = pos!(); aux::callback_inlined(|aux_pos| {
         check!(counter; main_pos, outer_pos, inner_pos, aux_pos);
     });
+
+    // this tests a distinction between two independent calls to the inlined function.
+    // (un)fortunately, LLVM somehow merges two consecutive such calls into one node.
+    inner_further_inlined(counter, main_pos, outer_pos, pos!());
 }
 
 #[inline(never)]