Skip to content

Commit aa2cecf

Browse files
committed
normalize abort calls in miri tests
1 parent 3d6db4d commit aa2cecf

29 files changed

+37
-36
lines changed

library/std/src/sys/pal/windows/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ pub fn abort_internal() -> ! {
353353

354354
#[cfg(miri)]
355355
pub fn abort_internal() -> ! {
356-
crate::intrinsics::abort();
356+
crate::intrinsics::abort()
357357
}
358358

359359
/// Align the inner value to 8 bytes.

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

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@error-in-other-file: aborted
2-
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
32
//@normalize-stderr-test: "\| +\^+" -> "| ^"
43
#![feature(allocator_api)]
54

src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ memory allocation of 4 bytes failed
22
error: abnormal termination: the program aborted execution
33
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
44
|
5-
LL | ABORT();
5+
LL | ABORT()
66
| ^ the program aborted execution
77
|
88
= note: BACKTRACE:

src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ thread caused non-unwinding panic. aborting.
1111
error: abnormal termination: the program aborted execution
1212
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
1313
|
14-
LL | ABORT();
14+
LL | ABORT()
1515
| ^ the program aborted execution
1616
|
1717
= note: BACKTRACE:

src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ thread caused non-unwinding panic. aborting.
1111
error: abnormal termination: the program aborted execution
1212
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
1313
|
14-
LL | ABORT();
14+
LL | ABORT()
1515
| ^ the program aborted execution
1616
|
1717
= note: BACKTRACE:

src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@revisions: extern_block definition both
2-
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
32
//@normalize-stderr-test: "\| +\^+" -> "| ^"
43
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
54
//@normalize-stderr-test: "\n +at [^\n]+" -> ""

src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
21
//@normalize-stderr-test: "\| +\^+" -> "| ^"
32
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
43
//@normalize-stderr-test: "\n +at [^\n]+" -> ""

src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ thread caused non-unwinding panic. aborting.
77
error: abnormal termination: the program aborted execution
88
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
99
|
10-
LL | ABORT();
10+
LL | ABORT()
1111
| ^ the program aborted execution
1212
|
1313
= note: BACKTRACE:

src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
21
//@normalize-stderr-test: "\| +\^+" -> "| ^"
32
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
43
//@normalize-stderr-test: "\n +at [^\n]+" -> ""

src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ thread caused non-unwinding panic. aborting.
77
error: abnormal termination: the program aborted execution
88
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
99
|
10-
LL | ABORT();
10+
LL | ABORT()
1111
| ^ the program aborted execution
1212
|
1313
= note: BACKTRACE:

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

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@error-in-other-file: the program aborted execution
2-
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
32
//@normalize-stderr-test: "\| +\^+" -> "| ^"
43
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
54
//@normalize-stderr-test: "\n +at [^\n]+" -> ""

src/tools/miri/tests/fail/panic/abort_unwind.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ thread caused non-unwinding panic. aborting.
1111
error: abnormal termination: the program aborted execution
1212
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
1313
|
14-
LL | ABORT();
14+
LL | ABORT()
1515
| ^ the program aborted execution
1616
|
1717
= note: BACKTRACE:

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

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
21
//@normalize-stderr-test: "\| +\^+" -> "| ^"
32
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
43
//@normalize-stderr-test: "\n +at [^\n]+" -> ""

src/tools/miri/tests/fail/panic/double_panic.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ thread caused non-unwinding panic. aborting.
1414
error: abnormal termination: the program aborted execution
1515
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
1616
|
17-
LL | ABORT();
17+
LL | ABORT()
1818
| ^ the program aborted execution
1919
|
2020
= note: BACKTRACE:

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@error-in-other-file: the program aborted execution
22
//@normalize-stderr-test: "\| +\^+" -> "| ^"
3-
//@normalize-stderr-test: "unsafe \{ libc::abort\(\); \}|core::intrinsics::abort\(\);" -> "ABORT();"
3+
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|core::intrinsics::abort\(\)" -> "ABORT()"
44
//@compile-flags: -C panic=abort
55

66
fn main() {

src/tools/miri/tests/fail/panic/panic_abort1.stderr

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ panicking from libstd
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66
error: abnormal termination: the program aborted execution
7-
--> RUSTLIB/panic_abort/src/lib.rs:LL:CC
7+
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
88
|
9-
LL | ABORT();
9+
LL | ABORT()
1010
| ^ the program aborted execution
1111
|
1212
= note: BACKTRACE:
13-
= note: inside `panic_abort::__rust_start_panic::abort` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
13+
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
14+
= note: inside `std::process::abort` at RUSTLIB/std/src/process.rs:LL:CC
15+
= note: inside `std::rt::__rust_abort` at RUSTLIB/std/src/rt.rs:LL:CC
1416
= note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
1517
= note: inside `std::panicking::rust_panic` at RUSTLIB/std/src/panicking.rs:LL:CC
1618
= note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@error-in-other-file: the program aborted execution
22
//@normalize-stderr-test: "\| +\^+" -> "| ^"
3-
//@normalize-stderr-test: "unsafe \{ libc::abort\(\); \}|core::intrinsics::abort\(\);" -> "ABORT();"
3+
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|core::intrinsics::abort\(\)" -> "ABORT()"
44
//@compile-flags: -C panic=abort
55

66
fn main() {

src/tools/miri/tests/fail/panic/panic_abort2.stderr

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ thread 'main' panicked at tests/fail/panic/panic_abort2.rs:LL:CC:
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66
error: abnormal termination: the program aborted execution
7-
--> RUSTLIB/panic_abort/src/lib.rs:LL:CC
7+
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
88
|
9-
LL | ABORT();
9+
LL | ABORT()
1010
| ^ the program aborted execution
1111
|
1212
= note: BACKTRACE:
13-
= note: inside `panic_abort::__rust_start_panic::abort` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
13+
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
14+
= note: inside `std::process::abort` at RUSTLIB/std/src/process.rs:LL:CC
15+
= note: inside `std::rt::__rust_abort` at RUSTLIB/std/src/rt.rs:LL:CC
1416
= note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
1517
= note: inside `std::panicking::rust_panic` at RUSTLIB/std/src/panicking.rs:LL:CC
1618
= note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@error-in-other-file: the program aborted execution
22
//@normalize-stderr-test: "\| +\^+" -> "| ^"
3-
//@normalize-stderr-test: "unsafe \{ libc::abort\(\); \}|core::intrinsics::abort\(\);" -> "ABORT();"
3+
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|core::intrinsics::abort\(\)" -> "ABORT()"
44
//@compile-flags: -C panic=abort
55

66
fn main() {

src/tools/miri/tests/fail/panic/panic_abort3.stderr

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ panicking from libcore
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66
error: abnormal termination: the program aborted execution
7-
--> RUSTLIB/panic_abort/src/lib.rs:LL:CC
7+
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
88
|
9-
LL | ABORT();
9+
LL | ABORT()
1010
| ^ the program aborted execution
1111
|
1212
= note: BACKTRACE:
13-
= note: inside `panic_abort::__rust_start_panic::abort` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
13+
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
14+
= note: inside `std::process::abort` at RUSTLIB/std/src/process.rs:LL:CC
15+
= note: inside `std::rt::__rust_abort` at RUSTLIB/std/src/rt.rs:LL:CC
1416
= note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
1517
= note: inside `std::panicking::rust_panic` at RUSTLIB/std/src/panicking.rs:LL:CC
1618
= note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@error-in-other-file: the program aborted execution
22
//@normalize-stderr-test: "\| +\^+" -> "| ^"
3-
//@normalize-stderr-test: "unsafe \{ libc::abort\(\); \}|core::intrinsics::abort\(\);" -> "ABORT();"
3+
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|core::intrinsics::abort\(\)" -> "ABORT()"
44
//@compile-flags: -C panic=abort
55

66
fn main() {

src/tools/miri/tests/fail/panic/panic_abort4.stderr

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ thread 'main' panicked at tests/fail/panic/panic_abort4.rs:LL:CC:
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66
error: abnormal termination: the program aborted execution
7-
--> RUSTLIB/panic_abort/src/lib.rs:LL:CC
7+
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
88
|
9-
LL | ABORT();
9+
LL | ABORT()
1010
| ^ the program aborted execution
1111
|
1212
= note: BACKTRACE:
13-
= note: inside `panic_abort::__rust_start_panic::abort` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
13+
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
14+
= note: inside `std::process::abort` at RUSTLIB/std/src/process.rs:LL:CC
15+
= note: inside `std::rt::__rust_abort` at RUSTLIB/std/src/rt.rs:LL:CC
1416
= note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
1517
= note: inside `std::panicking::rust_panic` at RUSTLIB/std/src/panicking.rs:LL:CC
1618
= note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC

src/tools/miri/tests/fail/ptr_swap_nonoverlapping.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! This is a regression test for <https://github.com/rust-lang/miri/issues/4188>: The precondition
22
//! check in `ptr::swap_nonoverlapping` was incorrectly disabled in Miri.
3-
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
43
//@normalize-stderr-test: "\| +\^+" -> "| ^"
54
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
65
//@normalize-stderr-test: "\n +at [^\n]+" -> ""

src/tools/miri/tests/fail/ptr_swap_nonoverlapping.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ thread caused non-unwinding panic. aborting.
99
error: abnormal termination: the program aborted execution
1010
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
1111
|
12-
LL | ABORT();
12+
LL | ABORT()
1313
| ^ the program aborted execution
1414
|
1515
= note: BACKTRACE:

src/tools/miri/tests/fail/terminate-terminator.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@compile-flags: -Zmir-opt-level=3 -Zinline-mir-hint-threshold=1000
2-
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
32
//@normalize-stderr-test: "\| +\^+" -> "| ^"
43
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
54
//@normalize-stderr-test: "\n +at [^\n]+" -> ""

src/tools/miri/tests/fail/terminate-terminator.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ thread caused non-unwinding panic. aborting.
1313
error: abnormal termination: the program aborted execution
1414
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
1515
|
16-
LL | ABORT();
16+
LL | ABORT()
1717
| ^ the program aborted execution
1818
|
1919
= note: BACKTRACE:

src/tools/miri/tests/fail/unwind-action-terminate.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@error-in-other-file: aborted execution
2-
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
32
//@normalize-stderr-test: "\| +\^+" -> "| ^"
43
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
54
//@normalize-stderr-test: "\n +at [^\n]+" -> ""

src/tools/miri/tests/fail/unwind-action-terminate.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ thread caused non-unwinding panic. aborting.
1111
error: abnormal termination: the program aborted execution
1212
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
1313
|
14-
LL | ABORT();
14+
LL | ABORT()
1515
| ^ the program aborted execution
1616
|
1717
= note: BACKTRACE:

src/tools/miri/tests/ui.rs

+2
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ regexes! {
269269
"[0-9]+ byte alignment but found [0-9]+" => "ALIGN byte alignment but found ALIGN",
270270
// erase thread caller ids
271271
r"call [0-9]+" => "call ID",
272+
// erase calls to platform-specific abort functions
273+
r"unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\)" => "ABORT()",
272274
// erase platform module paths
273275
r"\bsys::([a-z_]+)::[a-z]+::" => "sys::$1::PLATFORM::",
274276
// Windows file paths

0 commit comments

Comments
 (0)