Skip to content

Commit 82f2f2f

Browse files
committed
simplify no-std tests
set panic=abort so that we do not need this eh_personality thing
1 parent 9a308d4 commit 82f2f2f

File tree

5 files changed

+9
-17
lines changed

5 files changed

+9
-17
lines changed

src/tools/miri/tests/fail/alloc/no_global_allocator.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
//@compile-flags: -Cpanic=abort
12
//@normalize-stderr-test: "OS `.*`" -> "$$OS"
23
// Make sure we pretend the allocation symbols don't exist when there is no allocator
34

4-
#![feature(lang_items, start)]
5+
#![feature(start)]
56
#![no_std]
67

78
extern "Rust" {
@@ -21,6 +22,3 @@ fn start(_: isize, _: *const *const u8) -> isize {
2122
fn panic_handler(_: &core::panic::PanicInfo) -> ! {
2223
loop {}
2324
}
24-
25-
#[lang = "eh_personality"]
26-
fn eh_personality() {}

src/tools/miri/tests/fail/panic/no_std.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#![feature(lang_items, start, core_intrinsics)]
1+
#![feature(start, core_intrinsics)]
22
#![no_std]
3+
//@compile-flags: -Cpanic=abort
34
// windows tls dtors go through libstd right now, thus this test
45
// cannot pass. When windows tls dtors go through the special magic
56
// windows linker section, we can run this test on windows again.
@@ -36,6 +37,3 @@ fn panic_handler(panic_info: &core::panic::PanicInfo) -> ! {
3637
writeln!(HostErr, "{panic_info}").ok();
3738
core::intrinsics::abort(); //~ ERROR: the program aborted execution
3839
}
39-
40-
#[lang = "eh_personality"]
41-
fn eh_personality() {}

src/tools/miri/tests/pass/miri-alloc.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#![feature(lang_items, start)]
1+
#![feature(start)]
22
#![no_std]
3+
//@compile-flags: -Cpanic=abort
34
// windows tls dtors go through libstd right now, thus this test
45
// cannot pass. When windows tls dtors go through the special magic
56
// windows linker section, we can run this test on windows again.
@@ -24,6 +25,3 @@ fn start(_: isize, _: *const *const u8) -> isize {
2425
fn panic_handler(_: &core::panic::PanicInfo) -> ! {
2526
loop {}
2627
}
27-
28-
#[lang = "eh_personality"]
29-
fn eh_personality() {}

src/tools/miri/tests/pass/no_std.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#![feature(lang_items, start)]
1+
//@compile-flags: -Cpanic=abort
2+
#![feature(start)]
23
#![no_std]
34

45
// Plumbing to let us use `writeln!` to host stdout:
@@ -32,6 +33,3 @@ fn start(_: isize, _: *const *const u8) -> isize {
3233
fn panic_handler(_: &core::panic::PanicInfo) -> ! {
3334
loop {}
3435
}
35-
36-
#[lang = "eh_personality"]
37-
fn eh_personality() {}

src/tools/miri/tests/pass/overloaded-calls-simple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(lang_items, unboxed_closures, fn_traits)]
1+
#![feature(unboxed_closures, fn_traits)]
22

33
struct S3 {
44
x: i32,

0 commit comments

Comments
 (0)