Skip to content

Commit

Permalink
Expand c-unwind-abi-panic-abort test
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdd0121 committed May 12, 2022
1 parent c586bc3 commit a315bb4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@
#![crate_type = "lib"]
#![feature(c_unwind)]

extern "C-unwind" {
fn may_unwind();
}

// CHECK: @rust_item_that_can_unwind() unnamed_addr #0
#[no_mangle]
pub unsafe extern "C-unwind" fn rust_item_that_can_unwind() {
// CHECK: call void @_ZN4core9panicking15panic_no_unwind
may_unwind();
}

extern "C-unwind" {
// CHECK: @may_unwind() unnamed_addr #1
fn may_unwind();
}

// Now, make sure that the LLVM attributes for this functions are correct. First, make
// sure that the first item is correctly marked with the `nounwind` attribute:
//
// CHECK: attributes #0 = { {{.*}}nounwind{{.*}} }
//
// Now, check that foreign item is correctly marked without the `nounwind` attribute.
// CHECK-NOT: attributes #1 = { {{.*}}nounwind{{.*}} }

0 comments on commit a315bb4

Please sign in to comment.