Skip to content

Commit

Permalink
Remove c_unwind from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdd0121 committed Sep 23, 2023
1 parent 5fc8ef2 commit 732e311
Show file tree
Hide file tree
Showing 34 changed files with 13 additions and 41 deletions.
2 changes: 0 additions & 2 deletions src/tools/miri/tests/fail/concurrency/unwind_top_of_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

//! Unwinding past the top frame of a stack is Undefined Behavior.

#![feature(c_unwind)]

use std::{mem, ptr};

extern "C-unwind" fn thread_start(_null: *mut libc::c_void) -> *mut libc::c_void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@compile-flags: -Zmiri-disable-abi-check
#![feature(c_unwind)]

#[no_mangle]
extern "C-unwind" fn unwind() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
//@[definition,both]error-in-other-file: aborted execution
#![feature(rustc_attrs, c_unwind)]
#![feature(rustc_attrs)]

#[cfg_attr(any(definition, both), rustc_nounwind)]
#[no_mangle]
Expand Down
1 change: 0 additions & 1 deletion src/tools/miri/tests/fail/panic/bad_miri_start_panic.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@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
2 changes: 0 additions & 2 deletions src/tools/miri/tests/fail/panic/bad_unwind.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(c_unwind)]

//! Unwinding when the caller ABI is "C" (without "-unwind") is UB.

extern "C-unwind" fn unwind() {
Expand Down
2 changes: 0 additions & 2 deletions src/tools/miri/tests/fail/terminate-terminator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
// Enable MIR inlining to ensure that `TerminatorKind::UnwindTerminate` is generated
// instead of just `UnwindAction::Terminate`.

#![feature(c_unwind)]

struct Foo;

impl Drop for Foo {
Expand Down
2 changes: 0 additions & 2 deletions src/tools/miri/tests/fail/unwind-action-terminate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
//@normalize-stderr-test: "\| +\^+" -> "| ^"
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
#![feature(c_unwind)]

extern "C" fn panic_abort() {
panic!()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// 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)]
#![feature(unboxed_closures)]

use std::panic;

Expand Down
1 change: 0 additions & 1 deletion tests/codegen/catch-unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// ignore-loongarch64 FIXME

#![crate_type = "lib"]
#![feature(c_unwind)]

extern "C" {
fn bar();
Expand Down
1 change: 0 additions & 1 deletion tests/codegen/cffi/c-variadic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#![crate_type = "lib"]
#![feature(c_variadic)]
#![feature(c_unwind)]
#![no_std]
use core::ffi::VaList;

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/unwind-abis/aapcs-unwind-abi.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// needs-llvm-components: arm
// compile-flags: --target=armv7-unknown-linux-gnueabihf --crate-type=rlib -Cno-prepopulate-passes
#![no_core]
#![feature(no_core, lang_items, c_unwind)]
#![feature(no_core, lang_items)]
#[lang="sized"]
trait Sized { }

Expand Down
1 change: 0 additions & 1 deletion tests/codegen/unwind-abis/c-unwind-abi-panic-abort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// when the code is compiled with `panic=abort`.

#![crate_type = "lib"]
#![feature(c_unwind)]

// CHECK: @rust_item_that_can_unwind() unnamed_addr [[ATTR0:#[0-9]+]]
#[no_mangle]
Expand Down
1 change: 0 additions & 1 deletion tests/codegen/unwind-abis/c-unwind-abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// to prevent LLVM from inferring the attribute.

#![crate_type = "lib"]
#![feature(c_unwind)]

// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
#[no_mangle]
Expand Down
1 change: 0 additions & 1 deletion tests/codegen/unwind-abis/cdecl-unwind-abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// disable optimizations above to prevent LLVM from inferring the attribute.

#![crate_type = "lib"]
#![feature(c_unwind)]

// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
#[no_mangle]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/unwind-abis/fastcall-unwind-abi.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// needs-llvm-components: x86
// compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib -Cno-prepopulate-passes
#![no_core]
#![feature(no_core, lang_items, c_unwind)]
#![feature(no_core, lang_items)]
#[lang="sized"]
trait Sized { }

Expand Down
1 change: 0 additions & 1 deletion tests/codegen/unwind-abis/nounwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// ignore-wasm32-bare compiled with panic=abort by default

#![crate_type = "lib"]
#![feature(c_unwind)]

// We disable optimizations to prevent LLVM from inferring the attribute.

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/unwind-abis/stdcall-unwind-abi.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// needs-llvm-components: x86
// compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib -Cno-prepopulate-passes
#![no_core]
#![feature(no_core, lang_items, c_unwind)]
#![feature(no_core, lang_items)]
#[lang="sized"]
trait Sized { }

Expand Down
1 change: 0 additions & 1 deletion tests/codegen/unwind-abis/system-unwind-abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// optimizations above to prevent LLVM from inferring the attribute.

#![crate_type = "lib"]
#![feature(c_unwind)]

// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
#[no_mangle]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/unwind-abis/sysv64-unwind-abi.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// needs-llvm-components: x86
// compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib -Cno-prepopulate-passes
#![no_core]
#![feature(no_core, lang_items, c_unwind)]
#![feature(no_core, lang_items)]
#[lang="sized"]
trait Sized { }

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/unwind-abis/thiscall-unwind-abi.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// needs-llvm-components: x86
// compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib -Cno-prepopulate-passes
#![no_core]
#![feature(no_core, lang_items, c_unwind)]
#![feature(no_core, lang_items)]
#[lang="sized"]
trait Sized { }

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/unwind-abis/vectorcall-unwind-abi.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// needs-llvm-components: x86
// compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib -Cno-prepopulate-passes
#![no_core]
#![feature(no_core, lang_items, c_unwind, abi_vectorcall)]
#![feature(no_core, lang_items, abi_vectorcall)]
#[lang="sized"]
trait Sized { }

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/unwind-abis/win64-unwind-abi.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// needs-llvm-components: x86
// compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib -Cno-prepopulate-passes
#![no_core]
#![feature(no_core, lang_items, c_unwind)]
#![feature(no_core, lang_items)]
#[lang="sized"]
trait Sized { }

Expand Down
1 change: 0 additions & 1 deletion tests/codegen/unwind-and-panic-abort.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// compile-flags: -C panic=abort

#![crate_type = "lib"]
#![feature(c_unwind)]

extern "C-unwind" {
fn bar();
Expand Down
1 change: 0 additions & 1 deletion tests/codegen/unwind-extern-exports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// needs-unwind

#![crate_type = "lib"]
#![feature(c_unwind)]

// Make sure these all do *not* get the attribute.
// We disable optimizations to prevent LLVM from inferring the attribute.
Expand Down
1 change: 0 additions & 1 deletion tests/codegen/unwind-extern-imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// needs-unwind

#![crate_type = "lib"]
#![feature(c_unwind)]

extern "C" {
// CHECK: Function Attrs:{{.*}}nounwind
Expand Down
1 change: 0 additions & 1 deletion tests/run-coverage/abort.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(c_unwind)]
#![allow(unused_assignments)]

extern "C" fn might_abort(should_abort: bool) {
Expand Down
1 change: 0 additions & 1 deletion tests/run-make/forced-unwind-terminate-pof/foo.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Tests that forced unwind through POF Rust frames wouldn't trigger our terminating guards.

#![feature(c_unwind)]
#![no_main]

extern "C-unwind" {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/asm/x86_64/may_unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl Drop for Foo<'_> {
}
}

extern "C" fn panicky() {
extern "C-unwind" fn panicky() {
resume_unwind(Box::new(()));
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/const-eval/unwind-abort.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(c_unwind, const_extern_fn)]
#![feature(const_extern_fn)]

const extern "C" fn foo() {
panic!() //~ ERROR evaluation of constant value failed
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/unwind-abort.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// check-pass

#![feature(c_unwind, const_extern_fn)]
#![feature(const_extern_fn)]

// We don't unwind in const-eval anyways.
const extern "C" fn foo() {
Expand Down
1 change: 0 additions & 1 deletion tests/ui/panics/abort-on-panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//[next] compile-flags: -Ztrait-solver=next

#![allow(unused_must_use)]
#![feature(c_unwind)]
#![feature(panic_always_abort)]
// Since we mark some ABIs as "nounwind" to LLVM, we must make sure that
// we never unwind through them.
Expand Down
1 change: 0 additions & 1 deletion tests/ui/panics/panic-in-ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// normalize-stderr-test: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
// needs-unwind
// ignore-emscripten "RuntimeError" junk in output
#![feature(c_unwind)]

extern "C" fn panic_in_ffi() {
panic!("Test");
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/panics/panic-in-ffi.run.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
thread 'main' panicked at $DIR/panic-in-ffi.rs:13:5:
thread 'main' panicked at $DIR/panic-in-ffi.rs:12:5:
Test
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL:
Expand Down
4 changes: 0 additions & 4 deletions tests/ui/unwind-abis/feature-gate-c_unwind.rs

This file was deleted.

0 comments on commit 732e311

Please sign in to comment.