diff options
| author | Simonas Kazlauskas <git@kazlauskas.me> | 2021-06-11 14:22:13 +0300 |
|---|---|---|
| committer | Simonas Kazlauskas <git@kazlauskas.me> | 2021-07-06 13:12:15 +0300 |
| commit | 8240e7aa101815e2009c7d03b33dd2566d843e73 (patch) | |
| tree | acd63da2f2a9ec826d6d5844cdc8a4d3892dbd6c /src/test/codegen | |
| parent | 96859dbaf6229f131fbd427a32aaa95d4f9cb132 (diff) | |
| download | rust-8240e7aa101815e2009c7d03b33dd2566d843e73.tar.gz rust-8240e7aa101815e2009c7d03b33dd2566d843e73.zip | |
Replace per-target ABI denylist with an allowlist
It makes very little sense to maintain denylists of ABIs when, as far as non-generic ABIs are concerned, targets usually only support a small subset of the available ABIs. This has historically been a cause of bugs such as us allowing use of the platform-specific ABIs on x86 targets – these in turn would cause LLVM errors or assertions to fire. Fixes #57182 Sponsored by: standard.ai
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/unwind-abis/stdcall-unwind-abi.rs | 13 | ||||
| -rw-r--r-- | src/test/codegen/unwind-abis/thiscall-unwind-abi.rs | 14 |
2 files changed, 12 insertions, 15 deletions
diff --git a/src/test/codegen/unwind-abis/stdcall-unwind-abi.rs b/src/test/codegen/unwind-abis/stdcall-unwind-abi.rs index ed804ca278d..f1dff27ad67 100644 --- a/src/test/codegen/unwind-abis/stdcall-unwind-abi.rs +++ b/src/test/codegen/unwind-abis/stdcall-unwind-abi.rs @@ -1,15 +1,14 @@ -// compile-flags: -C opt-level=0 -// ignore-arm stdcall isn't supported -// ignore-aarch64 stdcall isn't supported -// ignore-riscv64 stdcall isn't supported +// 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)] +#[lang="sized"] +trait Sized { } // Test that `nounwind` atributes are correctly applied to exported `stdcall` and `stdcall-unwind` // extern functions. `stdcall-unwind` functions MUST NOT have this attribute. We disable // optimizations above to prevent LLVM from inferring the attribute. -#![crate_type = "lib"] -#![feature(c_unwind)] - // CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 { #[no_mangle] pub extern "stdcall" fn rust_item_that_cannot_unwind() { diff --git a/src/test/codegen/unwind-abis/thiscall-unwind-abi.rs b/src/test/codegen/unwind-abis/thiscall-unwind-abi.rs index aaa63ae55c3..d2cf041b72d 100644 --- a/src/test/codegen/unwind-abis/thiscall-unwind-abi.rs +++ b/src/test/codegen/unwind-abis/thiscall-unwind-abi.rs @@ -1,16 +1,14 @@ -// compile-flags: -C opt-level=0 -// ignore-arm thiscall isn't supported -// ignore-aarch64 thiscall isn't supported -// ignore-riscv64 thiscall isn't supported +// 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_thiscall)] +#[lang="sized"] +trait Sized { } // Test that `nounwind` atributes are correctly applied to exported `thiscall` and // `thiscall-unwind` extern functions. `thiscall-unwind` functions MUST NOT have this attribute. We // disable optimizations above to prevent LLVM from inferring the attribute. -#![crate_type = "lib"] -#![feature(abi_thiscall)] -#![feature(c_unwind)] - // CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 { #[no_mangle] pub extern "thiscall" fn rust_item_that_cannot_unwind() { |
