mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
72800d3b89
Except for `simd-intrinsic/`, which has a lot of files containing multiple types like `u8x64` which really are better when hand-formatted. There is a surprising amount of two-space indenting in this directory. Non-trivial changes: - `rustfmt::skip` needed in `debug-column.rs` to preserve meaning of the test. - `rustfmt::skip` used in a few places where hand-formatting read more nicely: `enum/enum-match.rs` - Line number adjustments needed for the expected output of `debug-column.rs` and `coroutine-debug.rs`.
30 lines
1.1 KiB
Rust
30 lines
1.1 KiB
Rust
//@ needs-llvm-components: x86
|
|
//@ compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib -Cno-prepopulate-passes
|
|
#![no_core]
|
|
#![feature(no_core, lang_items, c_unwind, abi_vectorcall)]
|
|
#[lang = "sized"]
|
|
trait Sized {}
|
|
|
|
// Test that `nounwind` attributes are correctly applied to exported `vectorcall` and
|
|
// `vectorcall-unwind` extern functions. `vectorcall-unwind` functions MUST NOT have this attribute.
|
|
// We disable optimizations above to prevent LLVM from inferring the attribute.
|
|
|
|
// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
|
|
#[no_mangle]
|
|
pub extern "vectorcall" fn rust_item_that_cannot_unwind() {}
|
|
|
|
// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 {
|
|
#[no_mangle]
|
|
pub extern "vectorcall-unwind" fn rust_item_that_can_unwind() {}
|
|
|
|
// Now, make some assertions that the LLVM attributes for these functions are correct. First, make
|
|
// sure that the first item is correctly marked with the `nounwind` attribute:
|
|
//
|
|
// CHECK: attributes #0 = { {{.*}}nounwind{{.*}} }
|
|
//
|
|
// Next, let's assert that the second item, which CAN unwind, does not have this attribute.
|
|
//
|
|
// CHECK: attributes #1 = {
|
|
// CHECK-NOT: nounwind
|
|
// CHECK: }
|