about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-20 11:22:59 +0000
committerbors <bors@rust-lang.org>2024-06-20 11:22:59 +0000
commit1aaab8b9f8dc488cadc4f083b3a11fb11b45cb77 (patch)
treebf9ae5334d13d7b36955e3815a3f02c0d5a90151 /tests/codegen
parent1d96de2a20e963abb8923dfa3c6175517dfb9d2c (diff)
parentbb2716effde9713efad15c269b35779a79c90271 (diff)
downloadrust-1aaab8b9f8dc488cadc4f083b3a11fb11b45cb77.tar.gz
rust-1aaab8b9f8dc488cadc4f083b3a11fb11b45cb77.zip
Auto merge of #116088 - nbdd0121:unwind, r=Amanieu,RalfJung
Stabilise `c_unwind`

Fix #74990
Fix #115285 (that's also where FCP is happening)

Marking as draft PR for now due to `compiler_builtins` issues

r? `@Amanieu`
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/align-byval-alignment-mismatch.rs4
-rw-r--r--tests/codegen/avr/avr-func-addrspace.rs2
-rw-r--r--tests/codegen/catch-unwind.rs1
-rw-r--r--tests/codegen/cffi/c-variadic.rs1
-rw-r--r--tests/codegen/debuginfo-inline-callsite-location.rs2
-rw-r--r--tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs2
-rw-r--r--tests/codegen/unwind-abis/aapcs-unwind-abi.rs2
-rw-r--r--tests/codegen/unwind-abis/c-unwind-abi-panic-abort.rs1
-rw-r--r--tests/codegen/unwind-abis/c-unwind-abi.rs1
-rw-r--r--tests/codegen/unwind-abis/cdecl-unwind-abi.rs1
-rw-r--r--tests/codegen/unwind-abis/fastcall-unwind-abi.rs2
-rw-r--r--tests/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs17
-rw-r--r--tests/codegen/unwind-abis/nounwind.rs1
-rw-r--r--tests/codegen/unwind-abis/stdcall-unwind-abi.rs2
-rw-r--r--tests/codegen/unwind-abis/system-unwind-abi.rs1
-rw-r--r--tests/codegen/unwind-abis/sysv64-unwind-abi.rs2
-rw-r--r--tests/codegen/unwind-abis/thiscall-unwind-abi.rs2
-rw-r--r--tests/codegen/unwind-abis/vectorcall-unwind-abi.rs2
-rw-r--r--tests/codegen/unwind-abis/win64-unwind-abi.rs2
-rw-r--r--tests/codegen/unwind-and-panic-abort.rs1
-rw-r--r--tests/codegen/unwind-extern-exports.rs1
-rw-r--r--tests/codegen/unwind-extern-imports.rs1
-rw-r--r--tests/codegen/wasm_exceptions.rs6
23 files changed, 15 insertions, 42 deletions
diff --git a/tests/codegen/align-byval-alignment-mismatch.rs b/tests/codegen/align-byval-alignment-mismatch.rs
index 71f2dd42ec2..835cc7393e5 100644
--- a/tests/codegen/align-byval-alignment-mismatch.rs
+++ b/tests/codegen/align-byval-alignment-mismatch.rs
@@ -1,9 +1,9 @@
 // ignore-tidy-linelength
 //@ revisions:i686-linux x86_64-linux
 
-//@[i686-linux] compile-flags: --target i686-unknown-linux-gnu
+//@[i686-linux] compile-flags: --target i686-unknown-linux-gnu -C panic=abort
 //@[i686-linux] needs-llvm-components: x86
-//@[x86_64-linux] compile-flags: --target x86_64-unknown-linux-gnu
+//@[x86_64-linux] compile-flags: --target x86_64-unknown-linux-gnu -C panic=abort
 //@[x86_64-linux] needs-llvm-components: x86
 
 // Tests that we correctly copy arguments into allocas when the alignment of the byval argument
diff --git a/tests/codegen/avr/avr-func-addrspace.rs b/tests/codegen/avr/avr-func-addrspace.rs
index 2d9efb52c7c..70834707564 100644
--- a/tests/codegen/avr/avr-func-addrspace.rs
+++ b/tests/codegen/avr/avr-func-addrspace.rs
@@ -1,4 +1,4 @@
-//@ compile-flags: -O --target=avr-unknown-gnu-atmega328 --crate-type=rlib
+//@ compile-flags: -O --target=avr-unknown-gnu-atmega328 --crate-type=rlib -C panic=abort
 //@ needs-llvm-components: avr
 
 // This test validates that function pointers can be stored in global variables
diff --git a/tests/codegen/catch-unwind.rs b/tests/codegen/catch-unwind.rs
index 4e1f9a88e95..48ad486fa03 100644
--- a/tests/codegen/catch-unwind.rs
+++ b/tests/codegen/catch-unwind.rs
@@ -14,7 +14,6 @@
 //@ ignore-loongarch64 FIXME
 
 #![crate_type = "lib"]
-#![feature(c_unwind)]
 
 extern "C" {
     fn bar();
diff --git a/tests/codegen/cffi/c-variadic.rs b/tests/codegen/cffi/c-variadic.rs
index 914d1623ed2..140d2f37f46 100644
--- a/tests/codegen/cffi/c-variadic.rs
+++ b/tests/codegen/cffi/c-variadic.rs
@@ -4,7 +4,6 @@
 
 #![crate_type = "lib"]
 #![feature(c_variadic)]
-#![feature(c_unwind)]
 #![no_std]
 use core::ffi::VaList;
 
diff --git a/tests/codegen/debuginfo-inline-callsite-location.rs b/tests/codegen/debuginfo-inline-callsite-location.rs
index f690c9c0937..aee07b4eb8c 100644
--- a/tests/codegen/debuginfo-inline-callsite-location.rs
+++ b/tests/codegen/debuginfo-inline-callsite-location.rs
@@ -1,4 +1,4 @@
-//@ compile-flags: -g -O
+//@ compile-flags: -g -O -C panic=abort
 
 // Check that each inline call site for the same function uses the same "sub-program" so that LLVM
 // can correctly merge the debug info if it merges the inlined code (e.g., for merging of tail
diff --git a/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs b/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs
index 977749ad578..ed0af90aaaf 100644
--- a/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs
+++ b/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs
@@ -1,4 +1,4 @@
-//@ compile-flags: --target riscv64gc-unknown-linux-gnu -O -C no-prepopulate-passes
+//@ compile-flags: --target riscv64gc-unknown-linux-gnu -O -C no-prepopulate-passes -C panic=abort
 //@ needs-llvm-components: riscv
 
 #![crate_type = "lib"]
diff --git a/tests/codegen/unwind-abis/aapcs-unwind-abi.rs b/tests/codegen/unwind-abis/aapcs-unwind-abi.rs
index 48c7ecf7824..0d9c7757883 100644
--- a/tests/codegen/unwind-abis/aapcs-unwind-abi.rs
+++ b/tests/codegen/unwind-abis/aapcs-unwind-abi.rs
@@ -1,7 +1,7 @@
 //@ needs-llvm-components: arm
 //@ compile-flags: --target=armv7-unknown-linux-gnueabihf --crate-type=rlib -Cno-prepopulate-passes
 #![no_core]
-#![feature(no_core, lang_items, c_unwind)]
+#![feature(no_core, lang_items)]
 #[lang = "sized"]
 trait Sized {}
 
diff --git a/tests/codegen/unwind-abis/c-unwind-abi-panic-abort.rs b/tests/codegen/unwind-abis/c-unwind-abi-panic-abort.rs
index 8bb2122946f..8d2745ba2f7 100644
--- a/tests/codegen/unwind-abis/c-unwind-abi-panic-abort.rs
+++ b/tests/codegen/unwind-abis/c-unwind-abi-panic-abort.rs
@@ -4,7 +4,6 @@
 // when the code is compiled with `panic=abort`.
 
 #![crate_type = "lib"]
-#![feature(c_unwind)]
 
 // CHECK: @rust_item_that_can_unwind() unnamed_addr [[ATTR0:#[0-9]+]]
 #[no_mangle]
diff --git a/tests/codegen/unwind-abis/c-unwind-abi.rs b/tests/codegen/unwind-abis/c-unwind-abi.rs
index 99763943a6a..46c08b5fc4f 100644
--- a/tests/codegen/unwind-abis/c-unwind-abi.rs
+++ b/tests/codegen/unwind-abis/c-unwind-abi.rs
@@ -6,7 +6,6 @@
 // to prevent LLVM from inferring the attribute.
 
 #![crate_type = "lib"]
-#![feature(c_unwind)]
 
 // CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
 #[no_mangle]
diff --git a/tests/codegen/unwind-abis/cdecl-unwind-abi.rs b/tests/codegen/unwind-abis/cdecl-unwind-abi.rs
index 78dbb55b35a..8e643d6ce49 100644
--- a/tests/codegen/unwind-abis/cdecl-unwind-abi.rs
+++ b/tests/codegen/unwind-abis/cdecl-unwind-abi.rs
@@ -6,7 +6,6 @@
 // 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]
diff --git a/tests/codegen/unwind-abis/fastcall-unwind-abi.rs b/tests/codegen/unwind-abis/fastcall-unwind-abi.rs
index 3cbeaf51d96..4c7b2856e2e 100644
--- a/tests/codegen/unwind-abis/fastcall-unwind-abi.rs
+++ b/tests/codegen/unwind-abis/fastcall-unwind-abi.rs
@@ -1,7 +1,7 @@
 //@ 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)]
+#![feature(no_core, lang_items)]
 #[lang = "sized"]
 trait Sized {}
 
diff --git a/tests/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs b/tests/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs
deleted file mode 100644
index a7f7f2fb77f..00000000000
--- a/tests/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-//@ compile-flags: -C opt-level=0
-//@ needs-unwind
-
-#![crate_type = "lib"]
-
-// We disable optimizations to prevent LLVM from inferring the attribute.
-
-extern "C" {
-    fn bar();
-}
-
-// CHECK-NOT: Function Attrs:{{.*}}nounwind
-pub unsafe extern "C" fn foo() {
-    bar();
-}
-
-// Note that this test will get removed when `C-unwind` is fully stabilized
diff --git a/tests/codegen/unwind-abis/nounwind.rs b/tests/codegen/unwind-abis/nounwind.rs
index 80bf8d67091..e40ed48ca73 100644
--- a/tests/codegen/unwind-abis/nounwind.rs
+++ b/tests/codegen/unwind-abis/nounwind.rs
@@ -2,7 +2,6 @@
 //@ needs-unwind
 
 #![crate_type = "lib"]
-#![feature(c_unwind)]
 
 // We disable optimizations to prevent LLVM from inferring the attribute.
 
diff --git a/tests/codegen/unwind-abis/stdcall-unwind-abi.rs b/tests/codegen/unwind-abis/stdcall-unwind-abi.rs
index ffb235cd116..ffc11d1faef 100644
--- a/tests/codegen/unwind-abis/stdcall-unwind-abi.rs
+++ b/tests/codegen/unwind-abis/stdcall-unwind-abi.rs
@@ -1,7 +1,7 @@
 //@ 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)]
+#![feature(no_core, lang_items)]
 #[lang = "sized"]
 trait Sized {}
 
diff --git a/tests/codegen/unwind-abis/system-unwind-abi.rs b/tests/codegen/unwind-abis/system-unwind-abi.rs
index 1dd0e9bbbec..5f910248346 100644
--- a/tests/codegen/unwind-abis/system-unwind-abi.rs
+++ b/tests/codegen/unwind-abis/system-unwind-abi.rs
@@ -6,7 +6,6 @@
 // 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]
diff --git a/tests/codegen/unwind-abis/sysv64-unwind-abi.rs b/tests/codegen/unwind-abis/sysv64-unwind-abi.rs
index 9824009dc55..c869ca7e2b8 100644
--- a/tests/codegen/unwind-abis/sysv64-unwind-abi.rs
+++ b/tests/codegen/unwind-abis/sysv64-unwind-abi.rs
@@ -1,7 +1,7 @@
 //@ needs-llvm-components: x86
 //@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib -Cno-prepopulate-passes
 #![no_core]
-#![feature(no_core, lang_items, c_unwind)]
+#![feature(no_core, lang_items)]
 #[lang = "sized"]
 trait Sized {}
 
diff --git a/tests/codegen/unwind-abis/thiscall-unwind-abi.rs b/tests/codegen/unwind-abis/thiscall-unwind-abi.rs
index a96f4d5a350..19b23ee47ba 100644
--- a/tests/codegen/unwind-abis/thiscall-unwind-abi.rs
+++ b/tests/codegen/unwind-abis/thiscall-unwind-abi.rs
@@ -1,7 +1,7 @@
 //@ 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)]
+#![feature(no_core, lang_items)]
 #[lang = "sized"]
 trait Sized {}
 
diff --git a/tests/codegen/unwind-abis/vectorcall-unwind-abi.rs b/tests/codegen/unwind-abis/vectorcall-unwind-abi.rs
index 9929e3e3703..b420f67ca9b 100644
--- a/tests/codegen/unwind-abis/vectorcall-unwind-abi.rs
+++ b/tests/codegen/unwind-abis/vectorcall-unwind-abi.rs
@@ -1,7 +1,7 @@
 //@ 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)]
+#![feature(no_core, lang_items, abi_vectorcall)]
 #[lang = "sized"]
 trait Sized {}
 
diff --git a/tests/codegen/unwind-abis/win64-unwind-abi.rs b/tests/codegen/unwind-abis/win64-unwind-abi.rs
index a45a94f628d..2697d3cbcd6 100644
--- a/tests/codegen/unwind-abis/win64-unwind-abi.rs
+++ b/tests/codegen/unwind-abis/win64-unwind-abi.rs
@@ -1,7 +1,7 @@
 //@ needs-llvm-components: x86
 //@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib -Cno-prepopulate-passes
 #![no_core]
-#![feature(no_core, lang_items, c_unwind)]
+#![feature(no_core, lang_items)]
 #[lang = "sized"]
 trait Sized {}
 
diff --git a/tests/codegen/unwind-and-panic-abort.rs b/tests/codegen/unwind-and-panic-abort.rs
index 430502308cf..8efa140058a 100644
--- a/tests/codegen/unwind-and-panic-abort.rs
+++ b/tests/codegen/unwind-and-panic-abort.rs
@@ -1,7 +1,6 @@
 //@ compile-flags: -C panic=abort
 
 #![crate_type = "lib"]
-#![feature(c_unwind)]
 
 extern "C-unwind" {
     fn bar();
diff --git a/tests/codegen/unwind-extern-exports.rs b/tests/codegen/unwind-extern-exports.rs
index ea59748b3bc..e692fd1a547 100644
--- a/tests/codegen/unwind-extern-exports.rs
+++ b/tests/codegen/unwind-extern-exports.rs
@@ -2,7 +2,6 @@
 //@ needs-unwind
 
 #![crate_type = "lib"]
-#![feature(c_unwind)]
 
 // Make sure these all do *not* get the attribute.
 // We disable optimizations to prevent LLVM from inferring the attribute.
diff --git a/tests/codegen/unwind-extern-imports.rs b/tests/codegen/unwind-extern-imports.rs
index 790e4def8b3..dfae8aae64a 100644
--- a/tests/codegen/unwind-extern-imports.rs
+++ b/tests/codegen/unwind-extern-imports.rs
@@ -2,7 +2,6 @@
 //@ needs-unwind
 
 #![crate_type = "lib"]
-#![feature(c_unwind)]
 
 extern "C" {
     // CHECK: Function Attrs:{{.*}}nounwind
diff --git a/tests/codegen/wasm_exceptions.rs b/tests/codegen/wasm_exceptions.rs
index 3910850e03a..719499dd8ea 100644
--- a/tests/codegen/wasm_exceptions.rs
+++ b/tests/codegen/wasm_exceptions.rs
@@ -3,12 +3,12 @@
 
 #![crate_type = "lib"]
 #![feature(core_intrinsics)]
-#![feature(rustc_attrs)]
 
-extern "C" {
+extern "C-unwind" {
     fn may_panic();
+}
 
-    #[rustc_nounwind]
+extern "C" {
     fn log_number(number: usize);
 }