Skip to content

Commit 5f994f5

Browse files
committed
Fix a bunch of rust_eh_personality signatures
1 parent e75895d commit 5f994f5

File tree

1 file changed

+203
-1
lines changed

1 file changed

+203
-1
lines changed

scripts/test_rustc_tests.sh

Lines changed: 203 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ rm tests/ui/asm/x86_64/issue-96797.rs # const and sym inline asm operands don't
5151
rm tests/ui/asm/global-asm-mono-sym-fn.rs # same
5252
rm tests/ui/asm/naked-asm-mono-sym-fn.rs # same
5353
rm tests/ui/asm/x86_64/goto.rs # inline asm labels not supported
54+
rm tests/ui/asm/aarch64/may_unwind.rs # inline asm unwind not supported
55+
rm tests/ui/asm/may_unwind.rs # same
5456
rm tests/ui/simd/simd-bitmask-notpow2.rs # non-pow-of-2 simd vector sizes
5557
rm -r tests/run-make/embed-source-dwarf # embedding sources in debuginfo
5658

@@ -71,6 +73,7 @@ rm -r tests/ui/instrument-coverage/
7173
# ==================
7274
rm tests/ui/codegen/issue-28950.rs # depends on stack size optimizations
7375
rm tests/ui/codegen/init-large-type.rs # same
76+
rm tests/ui/codegen/StackColoring-not-blowup-stack-issue-40883.rs # same
7477
rm -r tests/run-make/fmt-write-bloat/ # tests an optimization
7578
rm tests/ui/statics/const_generics.rs # same
7679
rm tests/ui/linking/executable-no-mangle-strip.rs # requires --gc-sections to work for statics
@@ -130,11 +133,13 @@ rm -r tests/run-make/export # same
130133
# ============
131134
rm -r tests/run-make/extern-fn-explicit-align # argument alignment not yet supported
132135
rm -r tests/run-make/panic-abort-eh_frame # .eh_frame emitted with panic=abort
136+
rm -r tests/run-make/forced-unwind-terminate-pof # adding wrong terminate guard
133137

134138
# bugs in the test suite
135139
# ======================
136140
rm tests/ui/process/nofile-limit.rs # TODO some AArch64 linking issue
137141
rm -r tests/ui/codegen/equal-pointers-unequal # make incorrect assumptions about the location of stack variables
142+
rm tests/incremental/extern_static/issue-49153.rs # references undefined symbol
138143

139144
rm tests/ui/stdio-is-blocking.rs # really slow with unoptimized libstd
140145
rm tests/ui/intrinsics/panic-uninitialized-zeroed.rs # same
@@ -155,8 +160,205 @@ index 073116933bd..c3e4578204d 100644
155160
.arg("-o")
156161
.arg(&recipe_bin)
157162
// Specify library search paths for \`run_make_support\`.
163+
diff --git a/tests/run-make/bin-emit-no-symbols/app.rs b/tests/run-make/bin-emit-no-symbols/app.rs
164+
index e9dc1e9744f..ad74fcc43dc 100644
165+
--- a/tests/run-make/bin-emit-no-symbols/app.rs
166+
+++ b/tests/run-make/bin-emit-no-symbols/app.rs
167+
@@ -12,7 +12,15 @@ fn panic(_: &PanicInfo) -> ! {
168+
}
169+
170+
#[lang = "eh_personality"]
171+
-fn eh() {}
172+
+fn eh(
173+
+ _version: i32,
174+
+ _actions: i32,
175+
+ _exception_class: u64,
176+
+ _exception_object: *mut (),
177+
+ _context: *mut (),
178+
+) -> i32 {
179+
+ loop {}
180+
+}
181+
182+
#[alloc_error_handler]
183+
fn oom(_: Layout) -> ! {
184+
diff --git a/tests/run-make/crate-circular-deps-link/a.rs b/tests/run-make/crate-circular-deps-link/a.rs
185+
index a54f429550e..99b2b65049d 100644
186+
--- a/tests/run-make/crate-circular-deps-link/a.rs
187+
+++ b/tests/run-make/crate-circular-deps-link/a.rs
188+
@@ -21,6 +21,12 @@ extern "C" fn __rust_foreign_exception() -> ! {
189+
}
190+
191+
#[lang = "eh_personality"]
192+
-fn eh_personality() {
193+
+fn eh_personality(
194+
+ _version: i32,
195+
+ _actions: i32,
196+
+ _exception_class: u64,
197+
+ _exception_object: *mut (),
198+
+ _context: *mut (),
199+
+) -> i32 {
200+
loop {}
201+
}
202+
diff --git a/tests/run-make/no-alloc-shim/foo.rs b/tests/run-make/no-alloc-shim/foo.rs
203+
index b5d0d394d2b..a22307f41b3 100644
204+
--- a/tests/run-make/no-alloc-shim/foo.rs
205+
+++ b/tests/run-make/no-alloc-shim/foo.rs
206+
@@ -12,7 +12,13 @@ fn panic_handler(_: &core::panic::PanicInfo) -> ! {
207+
}
208+
209+
#[no_mangle]
210+
-extern "C" fn rust_eh_personality() {
211+
+extern "C" fn rust_eh_personality(
212+
+ _version: i32,
213+
+ _actions: i32,
214+
+ _exception_class: u64,
215+
+ _exception_object: *mut (),
216+
+ _context: *mut (),
217+
+) -> i32 {
218+
loop {}
219+
}
220+
221+
diff --git a/tests/ui/allocator/no_std-alloc-error-handler-custom.rs b/tests/ui/allocator/no_std-alloc-error-handler-custom.rs
222+
index 6bbfb72510d..d65d65643e5 100644
223+
--- a/tests/ui/allocator/no_std-alloc-error-handler-custom.rs
224+
+++ b/tests/ui/allocator/no_std-alloc-error-handler-custom.rs
225+
@@ -6,13 +6,14 @@
226+
//@ compile-flags:-C panic=abort
227+
//@ aux-build:helper.rs
228+
229+
-#![feature(rustc_private, lang_items)]
230+
+#![feature(rustc_private, lang_items, panic_unwind)]
231+
#![feature(alloc_error_handler)]
232+
#![no_std]
233+
#![no_main]
234+
235+
extern crate alloc;
236+
extern crate libc;
237+
+extern crate unwind;
238+
239+
// ARM targets need these symbols
240+
#[no_mangle]
241+
@@ -70,7 +71,15 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! {
242+
// in these libraries will refer to \`rust_eh_personality\` if LLVM can not *prove* the contents won't
243+
// unwind. So, for this test case we will define the symbol.
244+
#[lang = "eh_personality"]
245+
-extern "C" fn rust_eh_personality() {}
246+
+extern "C" fn rust_eh_personality(
247+
+ _version: i32,
248+
+ _actions: i32,
249+
+ _exception_class: u64,
250+
+ _exception_object: *mut (),
251+
+ _context: *mut (),
252+
+) -> i32 {
253+
+ loop {}
254+
+}
255+
256+
#[derive(Default, Debug)]
257+
struct Page(#[allow(dead_code)] [[u64; 32]; 16]);
258+
diff --git a/tests/ui/allocator/no_std-alloc-error-handler-default.rs b/tests/ui/allocator/no_std-alloc-error-handler-default.rs
259+
index 8bcf054ac85..2ff3394484b 100644
260+
--- a/tests/ui/allocator/no_std-alloc-error-handler-default.rs
261+
+++ b/tests/ui/allocator/no_std-alloc-error-handler-default.rs
262+
@@ -6,12 +6,13 @@
263+
//@ compile-flags:-C panic=abort
264+
//@ aux-build:helper.rs
265+
266+
-#![feature(rustc_private, lang_items)]
267+
+#![feature(rustc_private, lang_items, panic_unwind)]
268+
#![no_std]
269+
#![no_main]
270+
271+
extern crate alloc;
272+
extern crate libc;
273+
+extern crate unwind;
274+
275+
// ARM targets need these symbols
276+
#[no_mangle]
277+
@@ -57,7 +58,15 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! {
278+
// in these libraries will refer to \`rust_eh_personality\` if LLVM can not *prove* the contents won't
279+
// unwind. So, for this test case we will define the symbol.
280+
#[lang = "eh_personality"]
281+
-extern "C" fn rust_eh_personality() {}
282+
+extern "C" fn rust_eh_personality(
283+
+ _version: i32,
284+
+ _actions: i32,
285+
+ _exception_class: u64,
286+
+ _exception_object: *mut (),
287+
+ _context: *mut (),
288+
+) -> i32 {
289+
+ loop {}
290+
+}
291+
292+
#[derive(Default, Debug)]
293+
struct Page(#[allow(dead_code)] [[u64; 32]; 16]);
294+
diff --git a/tests/ui/extern-flag/auxiliary/panic_handler.rs b/tests/ui/extern-flag/auxiliary/panic_handler.rs
295+
index 9140ceed229..9607f0ed013 100644
296+
--- a/tests/ui/extern-flag/auxiliary/panic_handler.rs
297+
+++ b/tests/ui/extern-flag/auxiliary/panic_handler.rs
298+
@@ -12,4 +12,12 @@ pub fn begin_panic_handler(_info: &core::panic::PanicInfo<'_>) -> ! {
299+
}
300+
301+
#[lang = "eh_personality"]
302+
-extern "C" fn eh_personality() {}
303+
+extern "C" fn eh_personality(
304+
+ _version: i32,
305+
+ _actions: i32,
306+
+ _exception_class: u64,
307+
+ _exception_object: *mut (),
308+
+ _context: *mut (),
309+
+) -> i32 {
310+
+ loop {}
311+
+}
312+
diff --git a/tests/ui/no_std/simple-runs.rs b/tests/ui/no_std/simple-runs.rs
313+
index 8931ac7ed11..566aa8763b8 100644
314+
--- a/tests/ui/no_std/simple-runs.rs
315+
+++ b/tests/ui/no_std/simple-runs.rs
316+
@@ -4,6 +4,7 @@
317+
//@ compile-flags: -Cpanic=abort
318+
//@ ignore-wasm different \`main\` convention
319+
320+
+#![feature(lang_items)]
321+
#![no_std]
322+
#![no_main]
323+
324+
@@ -35,6 +36,17 @@ fn panic_handler(_info: &PanicInfo<'_>) -> ! {
325+
loop {}
326+
}
327+
328+
+#[lang = "eh_personality"]
329+
+extern "C" fn eh_personality(
330+
+ _version: i32,
331+
+ _actions: i32,
332+
+ _exception_class: u64,
333+
+ _exception_object: *mut (),
334+
+ _context: *mut (),
335+
+) -> i32 {
336+
+ loop {}
337+
+}
338+
+
339+
#[no_mangle]
340+
extern "C" fn main(_argc: c_int, _argv: *const *const c_char) -> c_int {
341+
0
342+
diff --git a/tests/ui/panic-runtime/incompatible-type.rs b/tests/ui/panic-runtime/incompatible-type.rs
343+
index 4cbcfec11c9..f82c23d68c2 100644
344+
--- a/tests/ui/panic-runtime/incompatible-type.rs
345+
+++ b/tests/ui/panic-runtime/incompatible-type.rs
346+
@@ -21,4 +21,12 @@ pub fn test(_: DropMe) {
347+
}
348+
349+
#[rustc_std_internal_symbol]
350+
-pub unsafe extern "C" fn rust_eh_personality() {}
351+
+pub unsafe extern "C" fn rust_eh_personality(
352+
+ _version: i32,
353+
+ _actions: i32,
354+
+ _exception_class: u64,
355+
+ _exception_object: *mut (),
356+
+ _context: *mut (),
357+
+) -> i32 {
358+
+ loop {}
359+
+}
158360
EOF
159361

160362
echo "[TEST] rustc test suite"
161-
COMPILETEST_FORCE_STAGE0=1 ./x.py test --stage 0 tests/{codegen-units,ui,incremental}
363+
COMPILETEST_FORCE_STAGE0=1 ./x.py test --stage 0 tests/{codegen-units,run-make,ui,incremental}
162364
popd

0 commit comments

Comments
 (0)