]>
git.proxmox.com Git - rustc.git/blob - tests/codegen/unwind-abis/aapcs-unwind-abi.rs
1 // needs-llvm-components: arm
2 // compile-flags: --target=armv7-unknown-linux-gnueabihf --crate-type=rlib -Cno-prepopulate-passes
4 #![feature(no_core, lang_items, c_unwind)]
8 // Test that `nounwind` attributes are correctly applied to exported `aapcs` and
9 // `aapcs-unwind` extern functions. `aapcs-unwind` functions MUST NOT have this attribute. We
10 // disable optimizations above to prevent LLVM from inferring the attribute.
12 // CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
14 pub extern "aapcs" fn rust_item_that_cannot_unwind() {
17 // CHECK: @rust_item_that_can_unwind() unnamed_addr #1 {
19 pub extern "aapcs-unwind" fn rust_item_that_can_unwind() {
22 // Now, make some assertions that the LLVM attributes for these functions are correct. First, make
23 // sure that the first item is correctly marked with the `nounwind` attribute:
25 // CHECK: attributes #0 = { {{.*}}nounwind{{.*}} }
27 // Next, let's assert that the second item, which CAN unwind, does not have this attribute.
29 // CHECK: attributes #1 = {
30 // CHECK-NOT: nounwind