Skip to content

Make the backtrace-debuginfo test less error prone #27650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/test/run-pass/backtrace-debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)]
Expand Down