Skip to content

Commit 9c85314

Browse files
authored
Unrolled build for #142955
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.
2 parents 2c2bb99 + 659da58 commit 9c85314

File tree

10 files changed

+77
-24
lines changed

10 files changed

+77
-24
lines changed

compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -151,20 +151,6 @@ rm tests/ui/process/process-panic-after-fork.rs # same
151151
cp ../dist/bin/rustdoc-clif ../dist/bin/rustdoc # some tests expect bin/rustdoc to exist
152152

153153
cat <<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\\"")
168154
diff --git a/src/tools/compiletest/src/runtest/run_make.rs b/src/tools/compiletest/src/runtest/run_make.rs
169155
index 073116933bd..c3e4578204d 100644
170156
--- a/src/tools/compiletest/src/runtest/run_make.rs

tests/run-make/bin-emit-no-symbols/app.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff 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]
1826
fn oom(_: Layout) -> ! {

tests/run-make/crate-circular-deps-link/a.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

tests/run-make/linker-warning/rmake.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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",

tests/run-make/no-alloc-shim/foo.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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

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

Lines changed: 11 additions & 2 deletions
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]
@@ -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)]
7685
struct Page(#[allow(dead_code)] [[u64; 32]; 16]);

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

Lines changed: 11 additions & 2 deletions
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]
@@ -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)]
6372
struct Page(#[allow(dead_code)] [[u64; 32]; 16]);

tests/ui/extern-flag/auxiliary/panic_handler.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
}

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

tests/ui/panic-runtime/incompatible-type.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
}

0 commit comments

Comments
 (0)