Skip to content

Fix tests for C-unwind ABI changes #1868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from Aug 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
71ff9b41e9ebd3e336019513917a7a8868d1cc66
996ff2e0a0f911f52bb1de6bdd0cfd5704de1fc9
5 changes: 2 additions & 3 deletions tests/compile-fail/abort-terminator.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// error-pattern: the program aborted
#![feature(unwind_attributes)]
#![feature(c_unwind)]

#[unwind(aborts)]
fn panic_abort() { panic!() }
extern "C" fn panic_abort() { panic!() }

fn main() {
panic_abort();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#[cfg_attr(any(definition, both), rustc_allocator_nounwind)]
#[no_mangle]
extern "C-unwind" fn nounwind() {
//[definition]~^ ERROR abnormal termination: the program aborted execution
//[both]~^^ ERROR abnormal termination: the program aborted execution
panic!();
}

Expand All @@ -14,6 +16,4 @@ fn main() {
}
unsafe { nounwind() }
//[extern_block]~^ ERROR unwinding past a stack frame that does not allow unwinding
//[definition]~^^ ERROR unwinding past a stack frame that does not allow unwinding
//[both]~^^^ ERROR unwinding past a stack frame that does not allow unwinding
}
15 changes: 0 additions & 15 deletions tests/compile-fail/function_calls/exported_symbol_bad_unwind3.rs

This file was deleted.

2 changes: 2 additions & 0 deletions tests/compile-fail/panic/bad_miri_start_panic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// compile-flags: -Zmiri-disable-abi-check
// This feature is required to trigger the error using the "C" ABI.
#![feature(c_unwind)]

extern "C" {
fn miri_start_panic(payload: *mut u8) -> !;
Expand Down
13 changes: 1 addition & 12 deletions tests/run-pass/function_calls/exported_symbol_good_unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@
// found in this form" errors works without `-C prefer-dynamic` (`panic!` calls foreign function
// `__rust_start_panic`).
// no-prefer-dynamic
#![feature(c_unwind, unboxed_closures, unwind_attributes)]
#![feature(c_unwind, unboxed_closures)]

use std::panic;

#[no_mangle]
#[unwind(allowed)]
extern "C" fn good_unwind_allowed() {
panic!();
}

#[no_mangle]
extern "C-unwind" fn good_unwind_c() {
panic!();
Expand All @@ -29,11 +23,6 @@ extern "rust-call" fn good_unwind_rust_call(_: ()) -> ! {
}

fn main() -> ! {
extern "C" {
#[unwind(allowed)]
fn good_unwind_allowed();
}
panic::catch_unwind(|| unsafe { good_unwind_allowed() }).unwrap_err();
extern "C-unwind" {
fn good_unwind_c();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_good_unwind.rs:12:5
thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_good_unwind.rs:11:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_good_unwind.rs:17:5
thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_good_unwind.rs:16:5
thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_good_unwind.rs:22:5
thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_good_unwind.rs:28:5
15 changes: 0 additions & 15 deletions tests/run-pass/function_calls/exported_symbol_unwind_allowed.rs

This file was deleted.

This file was deleted.