Skip to content

Commit 659da58

Browse files
committed
Fix a bunch of missing unwinder related definitions
cg_llvm likely just optimizes out their references for these tests, but cg_clif doesn't and would thus give a linker error.
1 parent fcb718b commit 659da58

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

tests/ui/allocator/no_std-alloc-error-handler-custom.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
//@ compile-flags:-C panic=abort
77
//@ aux-build:helper.rs
88

9-
#![feature(rustc_private, lang_items)]
9+
#![feature(rustc_private, lang_items, panic_unwind)]
1010
#![feature(alloc_error_handler)]
1111
#![no_std]
1212
#![no_main]
1313

1414
extern crate alloc;
1515
extern crate libc;
16+
extern crate unwind; // For _Unwind_Resume
1617

1718
// ARM targets need these symbols
1819
#[no_mangle]

tests/ui/allocator/no_std-alloc-error-handler-default.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
//@ compile-flags:-C panic=abort
77
//@ aux-build:helper.rs
88

9-
#![feature(rustc_private, lang_items)]
9+
#![feature(rustc_private, lang_items, panic_unwind)]
1010
#![no_std]
1111
#![no_main]
1212

1313
extern crate alloc;
1414
extern crate libc;
15+
extern crate unwind; // For _Unwind_Resume
1516

1617
// ARM targets need these symbols
1718
#[no_mangle]

tests/ui/no_std/simple-runs.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//@ compile-flags: -Cpanic=abort
55
//@ ignore-wasm different `main` convention
66

7+
#![feature(lang_items)]
78
#![no_std]
89
#![no_main]
910

@@ -35,6 +36,17 @@ fn panic_handler(_info: &PanicInfo<'_>) -> ! {
3536
loop {}
3637
}
3738

39+
#[lang = "eh_personality"]
40+
extern "C" fn rust_eh_personality(
41+
_version: i32,
42+
_actions: i32,
43+
_exception_class: u64,
44+
_exception_object: *mut (),
45+
_context: *mut (),
46+
) -> i32 {
47+
loop {}
48+
}
49+
3850
#[no_mangle]
3951
extern "C" fn main(_argc: c_int, _argv: *const *const c_char) -> c_int {
4052
0

0 commit comments

Comments
 (0)