1
Fork 0

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() #13, !dbg !467
    attributes #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.
This commit is contained in:
Pietro Albini 2023-05-23 15:11:17 +02:00
parent f3d597b31c
commit 5fdeae610d
No known key found for this signature in database
GPG key ID: CD76B35F7734769E
3 changed files with 4 additions and 4 deletions

View file

@ -6,11 +6,11 @@
fn main() {
unsafe {
// Column numbers are 1-based. Regression test for #65437.
// CHECK: call void @giraffe(), !dbg [[A:!.*]]
// CHECK: call void @giraffe(){{( #[0-9]+)?}}, !dbg [[A:!.*]]
giraffe();
// Column numbers use byte offests. Regression test for #67360
// CHECK: call void @turtle(), !dbg [[B:!.*]]
// CHECK: call void @turtle(){{( #[0-9]+)?}}, !dbg [[B:!.*]]
/* ż */ turtle();
// CHECK: [[A]] = !DILocation(line: 10, column: 9,