about summary refs log tree commit diff
path: root/src/test/codegen/unwind-abis
diff options
context:
space:
mode:
authorAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-05 09:13:28 +0100
committerAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-11 09:32:08 +0000
commitcf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch)
tree40a88d9a46aaf3e8870676eb2538378b75a263eb /src/test/codegen/unwind-abis
parentca855e6e42787ecd062d81d53336fe6788ef51a9 (diff)
Move /src/test to /tests
Diffstat (limited to 'src/test/codegen/unwind-abis')
-rw-r--r--src/test/codegen/unwind-abis/aapcs-unwind-abi.rs31
-rw-r--r--src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs28
-rw-r--r--src/test/codegen/unwind-abis/c-unwind-abi.rs29
-rw-r--r--src/test/codegen/unwind-abis/cdecl-unwind-abi.rs29
-rw-r--r--src/test/codegen/unwind-abis/fastcall-unwind-abi.rs31
-rw-r--r--src/test/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs16
-rw-r--r--src/test/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs17
-rw-r--r--src/test/codegen/unwind-abis/nounwind.rs17
-rw-r--r--src/test/codegen/unwind-abis/stdcall-unwind-abi.rs31
-rw-r--r--src/test/codegen/unwind-abis/system-unwind-abi.rs29
-rw-r--r--src/test/codegen/unwind-abis/sysv64-unwind-abi.rs31
-rw-r--r--src/test/codegen/unwind-abis/thiscall-unwind-abi.rs31
-rw-r--r--src/test/codegen/unwind-abis/vectorcall-unwind-abi.rs31
-rw-r--r--src/test/codegen/unwind-abis/win64-unwind-abi.rs31
14 files changed, 0 insertions, 382 deletions
diff --git a/src/test/codegen/unwind-abis/aapcs-unwind-abi.rs b/src/test/codegen/unwind-abis/aapcs-unwind-abi.rs
deleted file mode 100644
index c092e28a05a..00000000000
--- a/src/test/codegen/unwind-abis/aapcs-unwind-abi.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// 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)]
-#[lang="sized"]
-trait Sized { }
-
-// Test that `nounwind` attributes are correctly applied to exported `aapcs` and
-// `aapcs-unwind` extern functions. `aapcs-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 "aapcs" fn rust_item_that_cannot_unwind() {
-}
-
-// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 {
-#[no_mangle]
-pub extern "aapcs-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: }
diff --git a/src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs b/src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs
deleted file mode 100644
index ea5bae18e23..00000000000
--- a/src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-// compile-flags: -C panic=abort
-
-// Test that `nounwind` attributes are also applied to extern `C-unwind` Rust functions
-// 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]
-pub unsafe extern "C-unwind" fn rust_item_that_can_unwind() {
-    // Handle both legacy and v0 symbol mangling.
-    // CHECK: call void @{{.*core9panicking19panic_cannot_unwind}}
-    may_unwind();
-}
-
-extern "C-unwind" {
-    // CHECK: @may_unwind() unnamed_addr [[ATTR1:#[0-9]+]]
-    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 [[ATTR0]] = { {{.*}}nounwind{{.*}} }
-//
-// Now, check that foreign item is correctly marked without the `nounwind` attribute.
-// CHECK-NOT: attributes [[ATTR1]] = { {{.*}}nounwind{{.*}} }
diff --git a/src/test/codegen/unwind-abis/c-unwind-abi.rs b/src/test/codegen/unwind-abis/c-unwind-abi.rs
deleted file mode 100644
index e258dbcacd2..00000000000
--- a/src/test/codegen/unwind-abis/c-unwind-abi.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-// compile-flags: -C opt-level=0
-
-// Test that `nounwind` attributes are correctly applied to exported `C` and `C-unwind` extern
-// functions. `C-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 "C" fn rust_item_that_cannot_unwind() {
-}
-
-// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 {
-#[no_mangle]
-pub extern "C-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: }
diff --git a/src/test/codegen/unwind-abis/cdecl-unwind-abi.rs b/src/test/codegen/unwind-abis/cdecl-unwind-abi.rs
deleted file mode 100644
index 19a7228839a..00000000000
--- a/src/test/codegen/unwind-abis/cdecl-unwind-abi.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-// compile-flags: -C opt-level=0
-
-// Test that `nounwind` attributes are correctly applied to exported `cdecl` and
-// `cdecl-unwind` extern functions. `cdecl-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 "cdecl" fn rust_item_that_cannot_unwind() {
-}
-
-// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 {
-#[no_mangle]
-pub extern "cdecl-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: }
diff --git a/src/test/codegen/unwind-abis/fastcall-unwind-abi.rs b/src/test/codegen/unwind-abis/fastcall-unwind-abi.rs
deleted file mode 100644
index b74099a5d96..00000000000
--- a/src/test/codegen/unwind-abis/fastcall-unwind-abi.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// 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` attributes are correctly applied to exported `fastcall` and
-// `fastcall-unwind` extern functions. `fastcall-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 "fastcall" fn rust_item_that_cannot_unwind() {
-}
-
-// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 {
-#[no_mangle]
-pub extern "fastcall-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: }
diff --git a/src/test/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs b/src/test/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs
deleted file mode 100644
index 106d593b21d..00000000000
--- a/src/test/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// compile-flags: -C opt-level=0 -Cpanic=abort
-// ignore-wasm32-bare compiled with panic=abort by default
-
-#![crate_type = "lib"]
-
-// We disable optimizations to prevent LLVM from inferring the attribute.
-
-// CHECK: Function Attrs:{{.*}}nounwind
-// CHECK-NEXT: @foo
-#[no_mangle]
-pub extern "C" fn foo() {}
-
-// CHECK: Function Attrs:{{.*}}nounwind
-// CHECK-NEXT: @bar
-#[no_mangle]
-pub fn bar() {}
diff --git a/src/test/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs b/src/test/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs
deleted file mode 100644
index c1c5bbdda34..00000000000
--- a/src/test/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// compile-flags: -C opt-level=0
-// ignore-wasm32-bare compiled with panic=abort by default
-
-#![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/src/test/codegen/unwind-abis/nounwind.rs b/src/test/codegen/unwind-abis/nounwind.rs
deleted file mode 100644
index c46d717331b..00000000000
--- a/src/test/codegen/unwind-abis/nounwind.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// compile-flags: -C opt-level=0 -Cpanic=abort
-// ignore-wasm32-bare compiled with panic=abort by default
-
-#![crate_type = "lib"]
-#![feature(c_unwind)]
-
-// We disable optimizations to prevent LLVM from inferring the attribute.
-
-// CHECK: Function Attrs:{{.*}}nounwind
-// CHECK-NEXT: @foo
-#[no_mangle]
-pub extern "C" fn foo() {}
-
-// CHECK: Function Attrs:{{.*}}nounwind
-// CHECK-NEXT: @bar
-#[no_mangle]
-pub fn bar() {}
diff --git a/src/test/codegen/unwind-abis/stdcall-unwind-abi.rs b/src/test/codegen/unwind-abis/stdcall-unwind-abi.rs
deleted file mode 100644
index 8eff0719f8f..00000000000
--- a/src/test/codegen/unwind-abis/stdcall-unwind-abi.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// 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` attributes 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.
-
-// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
-#[no_mangle]
-pub extern "stdcall" fn rust_item_that_cannot_unwind() {
-}
-
-// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 {
-#[no_mangle]
-pub extern "stdcall-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: }
diff --git a/src/test/codegen/unwind-abis/system-unwind-abi.rs b/src/test/codegen/unwind-abis/system-unwind-abi.rs
deleted file mode 100644
index 2591c1d4814..00000000000
--- a/src/test/codegen/unwind-abis/system-unwind-abi.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-// compile-flags: -C opt-level=0
-
-// Test that `nounwind` attributes are correctly applied to exported `system` and `system-unwind`
-// extern functions. `system-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 "system" fn rust_item_that_cannot_unwind() {
-}
-
-// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 {
-#[no_mangle]
-pub extern "system-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: }
diff --git a/src/test/codegen/unwind-abis/sysv64-unwind-abi.rs b/src/test/codegen/unwind-abis/sysv64-unwind-abi.rs
deleted file mode 100644
index 694fde17c3c..00000000000
--- a/src/test/codegen/unwind-abis/sysv64-unwind-abi.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// 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)]
-#[lang="sized"]
-trait Sized { }
-
-// Test that `nounwind` attributes are correctly applied to exported `sysv64` and
-// `sysv64-unwind` extern functions. `sysv64-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 "sysv64" fn rust_item_that_cannot_unwind() {
-}
-
-// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 {
-#[no_mangle]
-pub extern "sysv64-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: }
diff --git a/src/test/codegen/unwind-abis/thiscall-unwind-abi.rs b/src/test/codegen/unwind-abis/thiscall-unwind-abi.rs
deleted file mode 100644
index 7e81367fc5b..00000000000
--- a/src/test/codegen/unwind-abis/thiscall-unwind-abi.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// 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` attributes 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.
-
-// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
-#[no_mangle]
-pub extern "thiscall" fn rust_item_that_cannot_unwind() {
-}
-
-// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 {
-#[no_mangle]
-pub extern "thiscall-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: }
diff --git a/src/test/codegen/unwind-abis/vectorcall-unwind-abi.rs b/src/test/codegen/unwind-abis/vectorcall-unwind-abi.rs
deleted file mode 100644
index d7eca2a9700..00000000000
--- a/src/test/codegen/unwind-abis/vectorcall-unwind-abi.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// 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: }
diff --git a/src/test/codegen/unwind-abis/win64-unwind-abi.rs b/src/test/codegen/unwind-abis/win64-unwind-abi.rs
deleted file mode 100644
index 6591348c35d..00000000000
--- a/src/test/codegen/unwind-abis/win64-unwind-abi.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// 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)]
-#[lang="sized"]
-trait Sized { }
-
-// Test that `nounwind` attributes are correctly applied to exported `win64` and
-// `win64-unwind` extern functions. `win64-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 "win64" fn rust_item_that_cannot_unwind() {
-}
-
-// CHECK: @rust_item_that_can_unwind() unnamed_addr #1 {
-#[no_mangle]
-pub extern "win64-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: }