File tree Expand file tree Collapse file tree 10 files changed +77
-24
lines changed
compiler/rustc_codegen_cranelift/scripts Expand file tree Collapse file tree 10 files changed +77
-24
lines changed Original file line number Diff line number Diff line change @@ -151,20 +151,6 @@ rm tests/ui/process/process-panic-after-fork.rs # same
151151cp ../dist/bin/rustdoc-clif ../dist/bin/rustdoc # some tests expect bin/rustdoc to exist
152152
153153cat << EOF | git apply -
154- diff --git a/tests/run-make/linker-warning/rmake.rs b/tests/run-make/linker-warning/rmake.rs
155- index 30387af428c..f7895b12961 100644
156- --- a/tests/run-make/linker-warning/rmake.rs
157- +++ b/tests/run-make/linker-warning/rmake.rs
158- @@ -57,7 +57,8 @@ fn main() {
159- .actual_text("(linker error)", out.stderr())
160- - .normalize(r#"/rustc[^/]*/"#, "/rustc/")
161- + .normalize(r#"/tmp/rustc[^/]*/"#, "/tmp/rustc/")
162- + .normalize("libpanic_abort", "libpanic_unwind")
163- .normalize(
164- regex::escape(run_make_support::build_root().to_str().unwrap()),
165- "/build-root",
166- )
167- .normalize(r#""[^"]*\/symbols.o""#, "\\ "/symbols.o\\ "")
168154diff --git a/src/tools/compiletest/src/runtest/run_make.rs b/src/tools/compiletest/src/runtest/run_make.rs
169155index 073116933bd..c3e4578204d 100644
170156--- a/src/tools/compiletest/src/runtest/run_make.rs
Original file line number Diff line number Diff line change @@ -12,7 +12,15 @@ fn panic(_: &PanicInfo) -> ! {
1212}
1313
1414#[ lang = "eh_personality" ]
15- fn eh ( ) { }
15+ fn eh (
16+ _version : i32 ,
17+ _actions : i32 ,
18+ _exception_class : u64 ,
19+ _exception_object : * mut ( ) ,
20+ _context : * mut ( ) ,
21+ ) -> i32 {
22+ loop { }
23+ }
1624
1725#[ alloc_error_handler]
1826fn oom ( _: Layout ) -> ! {
Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ extern "C" fn __rust_foreign_exception() -> ! {
2121}
2222
2323#[ lang = "eh_personality" ]
24- fn eh_personality ( ) {
24+ fn eh_personality (
25+ _version : i32 ,
26+ _actions : i32 ,
27+ _exception_class : u64 ,
28+ _exception_object : * mut ( ) ,
29+ _context : * mut ( ) ,
30+ ) -> i32 {
2531 loop { }
2632}
Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ fn main() {
5757 diff ( )
5858 . expected_file ( "short-error.txt" )
5959 . actual_text ( "(linker error)" , out. stderr ( ) )
60- . normalize ( r#"/rustc[^/]*/"# , "/rustc/" )
60+ . normalize ( r#"/rustc[^/_-]*/"# , "/rustc/" )
61+ . normalize ( "libpanic_abort" , "libpanic_unwind" )
6162 . normalize (
6263 regex:: escape ( run_make_support:: build_root ( ) . to_str ( ) . unwrap ( ) ) ,
6364 "/build-root" ,
Original file line number Diff line number Diff line change @@ -12,7 +12,13 @@ fn panic_handler(_: &core::panic::PanicInfo) -> ! {
1212}
1313
1414#[ no_mangle]
15- extern "C" fn rust_eh_personality ( ) {
15+ extern "C" fn rust_eh_personality (
16+ _version : i32 ,
17+ _actions : i32 ,
18+ _exception_class : u64 ,
19+ _exception_object : * mut ( ) ,
20+ _context : * mut ( ) ,
21+ ) -> i32 {
1622 loop { }
1723}
1824
Original file line number Diff line number Diff line change 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
1414extern crate alloc;
1515extern crate libc;
16+ extern crate unwind; // For _Unwind_Resume
1617
1718// ARM targets need these symbols
1819#[ no_mangle]
@@ -70,7 +71,15 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! {
7071// in these libraries will refer to `rust_eh_personality` if LLVM can not *prove* the contents won't
7172// unwind. So, for this test case we will define the symbol.
7273#[ lang = "eh_personality" ]
73- extern "C" fn rust_eh_personality ( ) { }
74+ extern "C" fn rust_eh_personality (
75+ _version : i32 ,
76+ _actions : i32 ,
77+ _exception_class : u64 ,
78+ _exception_object : * mut ( ) ,
79+ _context : * mut ( ) ,
80+ ) -> i32 {
81+ loop { }
82+ }
7483
7584#[ derive( Default , Debug ) ]
7685struct Page ( #[ allow( dead_code) ] [ [ u64 ; 32 ] ; 16 ] ) ;
Original file line number Diff line number Diff line change 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
1313extern crate alloc;
1414extern crate libc;
15+ extern crate unwind; // For _Unwind_Resume
1516
1617// ARM targets need these symbols
1718#[ no_mangle]
@@ -57,7 +58,15 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! {
5758// in these libraries will refer to `rust_eh_personality` if LLVM can not *prove* the contents won't
5859// unwind. So, for this test case we will define the symbol.
5960#[ lang = "eh_personality" ]
60- extern "C" fn rust_eh_personality ( ) { }
61+ extern "C" fn rust_eh_personality (
62+ _version : i32 ,
63+ _actions : i32 ,
64+ _exception_class : u64 ,
65+ _exception_object : * mut ( ) ,
66+ _context : * mut ( ) ,
67+ ) -> i32 {
68+ loop { }
69+ }
6170
6271#[ derive( Default , Debug ) ]
6372struct Page ( #[ allow( dead_code) ] [ [ u64 ; 32 ] ; 16 ] ) ;
Original file line number Diff line number Diff line change @@ -12,4 +12,12 @@ pub fn begin_panic_handler(_info: &core::panic::PanicInfo<'_>) -> ! {
1212}
1313
1414#[ lang = "eh_personality" ]
15- extern "C" fn eh_personality ( ) { }
15+ extern "C" fn eh_personality (
16+ _version : i32 ,
17+ _actions : i32 ,
18+ _exception_class : u64 ,
19+ _exception_object : * mut ( ) ,
20+ _context : * mut ( ) ,
21+ ) -> i32 {
22+ loop { }
23+ }
Original file line number Diff line number Diff line change 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]
3951extern "C" fn main ( _argc : c_int , _argv : * const * const c_char ) -> c_int {
4052 0
Original file line number Diff line number Diff line change @@ -21,4 +21,12 @@ pub fn test(_: DropMe) {
2121}
2222
2323#[ rustc_std_internal_symbol]
24- pub unsafe extern "C" fn rust_eh_personality ( ) { }
24+ pub unsafe extern "C" fn rust_eh_personality (
25+ _version : i32 ,
26+ _actions : i32 ,
27+ _exception_class : u64 ,
28+ _exception_object : * mut ( ) ,
29+ _context : * mut ( ) ,
30+ ) -> i32 {
31+ loop { }
32+ }
You can’t perform that action at this time.
0 commit comments