Skip to content

Commit 5fdeae6

Browse files
committed
codegen: allow extra attributes to functions when panic=abort
When compiling with panic=abort (or using a target that doesn't have unwinding support), the compiler adds the "nounwind" attribute to functions. This results in a different LLVM IR, which results in a #NNN added after the function name: tail call void @bar() rust-lang#13, !dbg !467 attributes rust-lang#13 = { nounwind } ...instead of: tail call void @bar(), !dbg !467 This commit changes the matchers to swallow the #NNN, as it's not needed for these specific tests.
1 parent f3d597b commit 5fdeae6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

tests/codegen/call-metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#![crate_type = "lib"]
77

88
pub fn test() {
9-
// CHECK: call noundef i8 @some_true(), !range [[R0:![0-9]+]]
9+
// CHECK: call noundef i8 @some_true(){{( #[0-9]+)?}}, !range [[R0:![0-9]+]]
1010
// CHECK: [[R0]] = !{i8 0, i8 3}
1111
some_true();
1212
}

tests/codegen/debug-column.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
fn main() {
77
unsafe {
88
// Column numbers are 1-based. Regression test for #65437.
9-
// CHECK: call void @giraffe(), !dbg [[A:!.*]]
9+
// CHECK: call void @giraffe(){{( #[0-9]+)?}}, !dbg [[A:!.*]]
1010
giraffe();
1111

1212
// Column numbers use byte offests. Regression test for #67360
13-
// CHECK: call void @turtle(), !dbg [[B:!.*]]
13+
// CHECK: call void @turtle(){{( #[0-9]+)?}}, !dbg [[B:!.*]]
1414
/* ż */ turtle();
1515

1616
// CHECK: [[A]] = !DILocation(line: 10, column: 9,

tests/codegen/mir-inlined-line-numbers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn example() {
1919
}
2020

2121
// CHECK-LABEL: @example
22-
// CHECK: tail call void @bar(), !dbg [[DBG_ID:![0-9]+]]
22+
// CHECK: tail call void @bar(){{( #[0-9]+)?}}, !dbg [[DBG_ID:![0-9]+]]
2323
// CHECK: [[DBG_ID]] = !DILocation(line: 7,
2424
// CHECK-SAME: inlinedAt: [[INLINE_ID:![0-9]+]])
2525
// CHECK: [[INLINE_ID]] = !DILocation(line: 18,

0 commit comments

Comments
 (0)