about summary refs log tree commit diff
path: root/tests/ui
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2025-06-24 19:45:34 -0700
committerGitHub <noreply@github.com>2025-06-24 19:45:34 -0700
commitc062c495a0e9dce51921c6d319d9498ce1265a3e (patch)
tree4b892b3d3d86644a417acd2d3e99d745affe75e9 /tests/ui
parentb5631095cd3fec73737a3883b07fcb0d7dbdcfb7 (diff)
parent659da5843bd0c176c47ca190d2b1cfaa690ffa09 (diff)
downloadrust-c062c495a0e9dce51921c6d319d9498ce1265a3e.tar.gz
rust-c062c495a0e9dce51921c6d319d9498ce1265a3e.zip
Rollup merge of #142955 - bjorn3:cg_clif_test_fixes, r=jieyouxu
Couple of test suite fixes for cg_clif

Most of these are required for getting the test suite running with panic=unwind for cg_clif.
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/allocator/no_std-alloc-error-handler-custom.rs13
-rw-r--r--tests/ui/allocator/no_std-alloc-error-handler-default.rs13
-rw-r--r--tests/ui/extern-flag/auxiliary/panic_handler.rs10
-rw-r--r--tests/ui/no_std/simple-runs.rs12
-rw-r--r--tests/ui/panic-runtime/incompatible-type.rs10
5 files changed, 52 insertions, 6 deletions
diff --git a/tests/ui/allocator/no_std-alloc-error-handler-custom.rs b/tests/ui/allocator/no_std-alloc-error-handler-custom.rs
index 6bbfb72510d..1b0f0608fc6 100644
--- a/tests/ui/allocator/no_std-alloc-error-handler-custom.rs
+++ b/tests/ui/allocator/no_std-alloc-error-handler-custom.rs
@@ -6,13 +6,14 @@
 //@ compile-flags:-C panic=abort
 //@ aux-build:helper.rs
 
-#![feature(rustc_private, lang_items)]
+#![feature(rustc_private, lang_items, panic_unwind)]
 #![feature(alloc_error_handler)]
 #![no_std]
 #![no_main]
 
 extern crate alloc;
 extern crate libc;
+extern crate unwind; // For _Unwind_Resume
 
 // ARM targets need these symbols
 #[no_mangle]
@@ -70,7 +71,15 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! {
 // in these libraries will refer to `rust_eh_personality` if LLVM can not *prove* the contents won't
 // unwind. So, for this test case we will define the symbol.
 #[lang = "eh_personality"]
-extern "C" fn rust_eh_personality() {}
+extern "C" fn rust_eh_personality(
+    _version: i32,
+    _actions: i32,
+    _exception_class: u64,
+    _exception_object: *mut (),
+    _context: *mut (),
+) -> i32 {
+    loop {}
+}
 
 #[derive(Default, Debug)]
 struct Page(#[allow(dead_code)] [[u64; 32]; 16]);
diff --git a/tests/ui/allocator/no_std-alloc-error-handler-default.rs b/tests/ui/allocator/no_std-alloc-error-handler-default.rs
index 8bcf054ac85..51ecf1a6731 100644
--- a/tests/ui/allocator/no_std-alloc-error-handler-default.rs
+++ b/tests/ui/allocator/no_std-alloc-error-handler-default.rs
@@ -6,12 +6,13 @@
 //@ compile-flags:-C panic=abort
 //@ aux-build:helper.rs
 
-#![feature(rustc_private, lang_items)]
+#![feature(rustc_private, lang_items, panic_unwind)]
 #![no_std]
 #![no_main]
 
 extern crate alloc;
 extern crate libc;
+extern crate unwind; // For _Unwind_Resume
 
 // ARM targets need these symbols
 #[no_mangle]
@@ -57,7 +58,15 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! {
 // in these libraries will refer to `rust_eh_personality` if LLVM can not *prove* the contents won't
 // unwind. So, for this test case we will define the symbol.
 #[lang = "eh_personality"]
-extern "C" fn rust_eh_personality() {}
+extern "C" fn rust_eh_personality(
+    _version: i32,
+    _actions: i32,
+    _exception_class: u64,
+    _exception_object: *mut (),
+    _context: *mut (),
+) -> i32 {
+    loop {}
+}
 
 #[derive(Default, Debug)]
 struct Page(#[allow(dead_code)] [[u64; 32]; 16]);
diff --git a/tests/ui/extern-flag/auxiliary/panic_handler.rs b/tests/ui/extern-flag/auxiliary/panic_handler.rs
index 9140ceed229..9607f0ed013 100644
--- a/tests/ui/extern-flag/auxiliary/panic_handler.rs
+++ b/tests/ui/extern-flag/auxiliary/panic_handler.rs
@@ -12,4 +12,12 @@ pub fn begin_panic_handler(_info: &core::panic::PanicInfo<'_>) -> ! {
 }
 
 #[lang = "eh_personality"]
-extern "C" fn eh_personality() {}
+extern "C" fn eh_personality(
+    _version: i32,
+    _actions: i32,
+    _exception_class: u64,
+    _exception_object: *mut (),
+    _context: *mut (),
+) -> i32 {
+    loop {}
+}
diff --git a/tests/ui/no_std/simple-runs.rs b/tests/ui/no_std/simple-runs.rs
index 8931ac7ed11..af44dfec311 100644
--- a/tests/ui/no_std/simple-runs.rs
+++ b/tests/ui/no_std/simple-runs.rs
@@ -4,6 +4,7 @@
 //@ compile-flags: -Cpanic=abort
 //@ ignore-wasm different `main` convention
 
+#![feature(lang_items)]
 #![no_std]
 #![no_main]
 
@@ -35,6 +36,17 @@ fn panic_handler(_info: &PanicInfo<'_>) -> ! {
     loop {}
 }
 
+#[lang = "eh_personality"]
+extern "C" fn rust_eh_personality(
+    _version: i32,
+    _actions: i32,
+    _exception_class: u64,
+    _exception_object: *mut (),
+    _context: *mut (),
+) -> i32 {
+    loop {}
+}
+
 #[no_mangle]
 extern "C" fn main(_argc: c_int, _argv: *const *const c_char) -> c_int {
     0
diff --git a/tests/ui/panic-runtime/incompatible-type.rs b/tests/ui/panic-runtime/incompatible-type.rs
index 4cbcfec11c9..f82c23d68c2 100644
--- a/tests/ui/panic-runtime/incompatible-type.rs
+++ b/tests/ui/panic-runtime/incompatible-type.rs
@@ -21,4 +21,12 @@ pub fn test(_: DropMe) {
 }
 
 #[rustc_std_internal_symbol]
-pub unsafe extern "C" fn rust_eh_personality() {}
+pub unsafe extern "C" fn rust_eh_personality(
+    _version: i32,
+    _actions: i32,
+    _exception_class: u64,
+    _exception_object: *mut (),
+    _context: *mut (),
+) -> i32 {
+    loop {}
+}