Skip to content

Commit 5812b1f

Browse files
committed
Remove c_unwind from tests and fix tests
1 parent ebdfcd9 commit 5812b1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+31
-75
lines changed

Diff for: src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(c_unwind)]
2-
31
#[no_mangle]
42
extern "C-unwind" fn unwind() {
53
panic!();

Diff for: src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
55
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
66
//@[definition,both]error-in-other-file: aborted execution
7-
#![feature(rustc_attrs, c_unwind)]
7+
#![feature(rustc_attrs)]
88

99
#[cfg_attr(any(definition, both), rustc_nounwind)]
1010
#[no_mangle]

Diff for: src/tools/miri/tests/fail/panic/bad_unwind.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(c_unwind)]
2-
31
//! Unwinding when the caller ABI is "C" (without "-unwind") is UB.
42
// The opposite version (callee does not allow unwinding) is impossible to
53
// even write: MIR validation catches functions that have `UnwindContinue` but

Diff for: src/tools/miri/tests/fail/terminate-terminator.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// Enable MIR inlining to ensure that `TerminatorKind::UnwindTerminate` is generated
88
// instead of just `UnwindAction::Terminate`.
99

10-
#![feature(c_unwind)]
11-
1210
struct Foo;
1311

1412
impl Drop for Foo {

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

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//@normalize-stderr-test: "\| +\^+" -> "| ^"
44
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
55
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
6-
#![feature(c_unwind)]
7-
86
extern "C" fn panic_abort() {
97
panic!()
108
}

Diff for: src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// found in this form" errors works without `-C prefer-dynamic` (`panic!` calls foreign function
33
// `__rust_start_panic`).
44
// no-prefer-dynamic
5-
#![feature(c_unwind, unboxed_closures)]
5+
#![feature(unboxed_closures)]
66

77
use std::panic;
88

Diff for: tests/assembly/asm/aarch64-modifiers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ assembly-output: emit-asm
2-
//@ compile-flags: -O
2+
//@ compile-flags: -O -C panic=abort
33
//@ compile-flags: --target aarch64-unknown-linux-gnu
44
//@ needs-llvm-components: aarch64
55

Diff for: tests/assembly/asm/arm-modifiers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ assembly-output: emit-asm
2-
//@ compile-flags: -O
2+
//@ compile-flags: -O -C panic=abort
33
//@ compile-flags: --target armv7-unknown-linux-gnueabihf
44
//@ compile-flags: -C target-feature=+neon
55
//@ needs-llvm-components: arm

Diff for: tests/assembly/asm/x86-modifiers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ revisions: x86_64 i686
22
//@ assembly-output: emit-asm
3-
//@ compile-flags: -O
3+
//@ compile-flags: -O -C panic=abort
44
//@[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
55
//@[x86_64] needs-llvm-components: x86
66
//@[i686] compile-flags: --target i686-unknown-linux-gnu

Diff for: tests/assembly/simd-bitmask.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//@ [aarch64] needs-llvm-components: aarch64
1212
//@ [aarch64] min-llvm-version: 18.0
1313
//@ assembly-output: emit-asm
14-
//@ compile-flags: --crate-type=lib -O
14+
//@ compile-flags: --crate-type=lib -O -C panic=abort
1515

1616
#![feature(no_core, lang_items, repr_simd, intrinsics)]
1717
#![no_core]

Diff for: tests/assembly/simd-intrinsic-gather.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//@ [x86-avx512] needs-llvm-components: x86
55
//@ [x86-avx512] min-llvm-version: 18.0
66
//@ assembly-output: emit-asm
7-
//@ compile-flags: --crate-type=lib -O
7+
//@ compile-flags: --crate-type=lib -O -C panic=abort
88

99
#![feature(no_core, lang_items, repr_simd, intrinsics)]
1010
#![no_core]

Diff for: tests/assembly/simd-intrinsic-mask-load.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
77
//@ [x86-avx512] needs-llvm-components: x86
88
//@ assembly-output: emit-asm
9-
//@ compile-flags: --crate-type=lib -O
9+
//@ compile-flags: --crate-type=lib -O -C panic=abort
1010

1111
#![feature(no_core, lang_items, repr_simd, intrinsics)]
1212
#![no_core]

Diff for: tests/assembly/simd-intrinsic-mask-reduce.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//@ [aarch64] needs-llvm-components: aarch64
99
//@ [aarch64] min-llvm-version: 18.0
1010
//@ assembly-output: emit-asm
11-
//@ compile-flags: --crate-type=lib -O
11+
//@ compile-flags: --crate-type=lib -O -C panic=abort
1212

1313
#![feature(no_core, lang_items, repr_simd, intrinsics)]
1414
#![no_core]

Diff for: tests/assembly/simd-intrinsic-mask-store.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
77
//@ [x86-avx512] needs-llvm-components: x86
88
//@ assembly-output: emit-asm
9-
//@ compile-flags: --crate-type=lib -O
9+
//@ compile-flags: --crate-type=lib -O -C panic=abort
1010

1111
#![feature(no_core, lang_items, repr_simd, intrinsics)]
1212
#![no_core]

Diff for: tests/assembly/simd-intrinsic-scatter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//@ [x86-avx512] needs-llvm-components: x86
55
//@ [x86-avx512] min-llvm-version: 18.0
66
//@ assembly-output: emit-asm
7-
//@ compile-flags: --crate-type=lib -O
7+
//@ compile-flags: --crate-type=lib -O -C panic=abort
88

99
#![feature(no_core, lang_items, repr_simd, intrinsics)]
1010
#![no_core]

Diff for: tests/assembly/simd-intrinsic-select.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//@ [aarch64] needs-llvm-components: aarch64
1010
//@ [aarch64] min-llvm-version: 18.0
1111
//@ assembly-output: emit-asm
12-
//@ compile-flags: --crate-type=lib -O
12+
//@ compile-flags: --crate-type=lib -O -C panic=abort
1313

1414
#![feature(no_core, lang_items, repr_simd, intrinsics)]
1515
#![no_core]

Diff for: tests/codegen/align-byval-alignment-mismatch.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// ignore-tidy-linelength
22
//@ revisions:i686-linux x86_64-linux
33

4-
//@[i686-linux] compile-flags: --target i686-unknown-linux-gnu
4+
//@[i686-linux] compile-flags: --target i686-unknown-linux-gnu -C panic=abort
55
//@[i686-linux] needs-llvm-components: x86
6-
//@[x86_64-linux] compile-flags: --target x86_64-unknown-linux-gnu
6+
//@[x86_64-linux] compile-flags: --target x86_64-unknown-linux-gnu -C panic=abort
77
//@[x86_64-linux] needs-llvm-components: x86
88

99
// Tests that we correctly copy arguments into allocas when the alignment of the byval argument

Diff for: tests/codegen/avr/avr-func-addrspace.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -O --target=avr-unknown-gnu-atmega328 --crate-type=rlib
1+
//@ compile-flags: -O --target=avr-unknown-gnu-atmega328 --crate-type=rlib -C panic=abort
22
//@ needs-llvm-components: avr
33

44
// This test validates that function pointers can be stored in global variables

Diff for: tests/codegen/catch-unwind.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
//@ ignore-loongarch64 FIXME
1515

1616
#![crate_type = "lib"]
17-
#![feature(c_unwind)]
1817

1918
extern "C" {
2019
fn bar();

Diff for: tests/codegen/cffi/c-variadic.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#![crate_type = "lib"]
66
#![feature(c_variadic)]
7-
#![feature(c_unwind)]
87
#![no_std]
98
use core::ffi::VaList;
109

Diff for: tests/codegen/debuginfo-inline-callsite-location.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -g -O
1+
//@ compile-flags: -g -O -C panic=abort
22

33
// Check that each inline call site for the same function uses the same "sub-program" so that LLVM
44
// can correctly merge the debug info if it merges the inlined code (e.g., for merging of tail

Diff for: tests/codegen/unwind-abis/aapcs-unwind-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ needs-llvm-components: arm
22
//@ compile-flags: --target=armv7-unknown-linux-gnueabihf --crate-type=rlib -Cno-prepopulate-passes
33
#![no_core]
4-
#![feature(no_core, lang_items, c_unwind)]
4+
#![feature(no_core, lang_items)]
55
#[lang = "sized"]
66
trait Sized {}
77

Diff for: tests/codegen/unwind-abis/c-unwind-abi-panic-abort.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// when the code is compiled with `panic=abort`.
55

66
#![crate_type = "lib"]
7-
#![feature(c_unwind)]
87

98
// CHECK: @rust_item_that_can_unwind() unnamed_addr [[ATTR0:#[0-9]+]]
109
#[no_mangle]

Diff for: tests/codegen/unwind-abis/c-unwind-abi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// to prevent LLVM from inferring the attribute.
77

88
#![crate_type = "lib"]
9-
#![feature(c_unwind)]
109

1110
// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
1211
#[no_mangle]

Diff for: tests/codegen/unwind-abis/cdecl-unwind-abi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// disable optimizations above to prevent LLVM from inferring the attribute.
77

88
#![crate_type = "lib"]
9-
#![feature(c_unwind)]
109

1110
// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
1211
#[no_mangle]

Diff for: tests/codegen/unwind-abis/fastcall-unwind-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ needs-llvm-components: x86
22
//@ compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib -Cno-prepopulate-passes
33
#![no_core]
4-
#![feature(no_core, lang_items, c_unwind)]
4+
#![feature(no_core, lang_items)]
55
#[lang = "sized"]
66
trait Sized {}
77

Diff for: tests/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs

-17
This file was deleted.

Diff for: tests/codegen/unwind-abis/nounwind.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//@ needs-unwind
33

44
#![crate_type = "lib"]
5-
#![feature(c_unwind)]
65

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

Diff for: tests/codegen/unwind-abis/stdcall-unwind-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ needs-llvm-components: x86
22
//@ compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib -Cno-prepopulate-passes
33
#![no_core]
4-
#![feature(no_core, lang_items, c_unwind)]
4+
#![feature(no_core, lang_items)]
55
#[lang = "sized"]
66
trait Sized {}
77

Diff for: tests/codegen/unwind-abis/system-unwind-abi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// optimizations above to prevent LLVM from inferring the attribute.
77

88
#![crate_type = "lib"]
9-
#![feature(c_unwind)]
109

1110
// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
1211
#[no_mangle]

Diff for: tests/codegen/unwind-abis/sysv64-unwind-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ needs-llvm-components: x86
22
//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib -Cno-prepopulate-passes
33
#![no_core]
4-
#![feature(no_core, lang_items, c_unwind)]
4+
#![feature(no_core, lang_items)]
55
#[lang = "sized"]
66
trait Sized {}
77

Diff for: tests/codegen/unwind-abis/thiscall-unwind-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ needs-llvm-components: x86
22
//@ compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib -Cno-prepopulate-passes
33
#![no_core]
4-
#![feature(no_core, lang_items, c_unwind)]
4+
#![feature(no_core, lang_items)]
55
#[lang = "sized"]
66
trait Sized {}
77

Diff for: tests/codegen/unwind-abis/vectorcall-unwind-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ needs-llvm-components: x86
22
//@ compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib -Cno-prepopulate-passes
33
#![no_core]
4-
#![feature(no_core, lang_items, c_unwind, abi_vectorcall)]
4+
#![feature(no_core, lang_items, abi_vectorcall)]
55
#[lang = "sized"]
66
trait Sized {}
77

Diff for: tests/codegen/unwind-abis/win64-unwind-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ needs-llvm-components: x86
22
//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib -Cno-prepopulate-passes
33
#![no_core]
4-
#![feature(no_core, lang_items, c_unwind)]
4+
#![feature(no_core, lang_items)]
55
#[lang = "sized"]
66
trait Sized {}
77

Diff for: tests/codegen/unwind-and-panic-abort.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ compile-flags: -C panic=abort
22

33
#![crate_type = "lib"]
4-
#![feature(c_unwind)]
54

65
extern "C-unwind" {
76
fn bar();

Diff for: tests/codegen/unwind-extern-exports.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//@ needs-unwind
33

44
#![crate_type = "lib"]
5-
#![feature(c_unwind)]
65

76
// Make sure these all do *not* get the attribute.
87
// We disable optimizations to prevent LLVM from inferring the attribute.

Diff for: tests/codegen/unwind-extern-imports.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//@ needs-unwind
33

44
#![crate_type = "lib"]
5-
#![feature(c_unwind)]
65

76
extern "C" {
87
// CHECK: Function Attrs:{{.*}}nounwind

Diff for: tests/coverage/abort.cov-map

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Function name: abort::main
2-
Raw bytes (89): 0x[01, 01, 0a, 01, 27, 05, 09, 03, 0d, 22, 11, 03, 0d, 03, 0d, 22, 15, 03, 0d, 03, 0d, 05, 09, 0d, 01, 0e, 01, 01, 1b, 03, 02, 0b, 00, 18, 22, 01, 0c, 00, 19, 11, 00, 1a, 02, 0a, 0e, 02, 0a, 00, 0b, 22, 02, 0c, 00, 19, 15, 00, 1a, 00, 31, 1a, 00, 31, 00, 32, 22, 04, 0c, 00, 19, 05, 00, 1a, 00, 31, 09, 00, 31, 00, 32, 27, 01, 09, 00, 17, 0d, 02, 05, 01, 02]
2+
Raw bytes (89): 0x[01, 01, 0a, 01, 27, 05, 09, 03, 0d, 22, 11, 03, 0d, 03, 0d, 22, 15, 03, 0d, 03, 0d, 05, 09, 0d, 01, 0d, 01, 01, 1b, 03, 02, 0b, 00, 18, 22, 01, 0c, 00, 19, 11, 00, 1a, 02, 0a, 0e, 02, 0a, 00, 0b, 22, 02, 0c, 00, 19, 15, 00, 1a, 00, 31, 1a, 00, 31, 00, 32, 22, 04, 0c, 00, 19, 05, 00, 1a, 00, 31, 09, 00, 31, 00, 32, 27, 01, 09, 00, 17, 0d, 02, 05, 01, 02]
33
Number of files: 1
44
- file 0 => global file 1
55
Number of expressions: 10
@@ -14,7 +14,7 @@ Number of expressions: 10
1414
- expression 8 operands: lhs = Expression(0, Add), rhs = Counter(3)
1515
- expression 9 operands: lhs = Counter(1), rhs = Counter(2)
1616
Number of file 0 mappings: 13
17-
- Code(Counter(0)) at (prev + 14, 1) to (start + 1, 27)
17+
- Code(Counter(0)) at (prev + 13, 1) to (start + 1, 27)
1818
- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 24)
1919
= (c0 + (c1 + c2))
2020
- Code(Expression(8, Sub)) at (prev + 1, 12) to (start + 0, 25)
@@ -36,13 +36,13 @@ Number of file 0 mappings: 13
3636
- Code(Counter(3)) at (prev + 2, 5) to (start + 1, 2)
3737

3838
Function name: abort::might_abort
39-
Raw bytes (21): 0x[01, 01, 01, 01, 05, 03, 01, 04, 01, 01, 14, 05, 02, 09, 01, 24, 02, 02, 0c, 03, 02]
39+
Raw bytes (21): 0x[01, 01, 01, 01, 05, 03, 01, 03, 01, 01, 14, 05, 02, 09, 01, 24, 02, 02, 0c, 03, 02]
4040
Number of files: 1
4141
- file 0 => global file 1
4242
Number of expressions: 1
4343
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
4444
Number of file 0 mappings: 3
45-
- Code(Counter(0)) at (prev + 4, 1) to (start + 1, 20)
45+
- Code(Counter(0)) at (prev + 3, 1) to (start + 1, 20)
4646
- Code(Counter(1)) at (prev + 2, 9) to (start + 1, 36)
4747
- Code(Expression(0, Sub)) at (prev + 2, 12) to (start + 3, 2)
4848
= (c0 - c1)

Diff for: tests/coverage/abort.coverage

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
LL| |#![feature(c_unwind)]
21
LL| |#![allow(unused_assignments)]
32
LL| |
43
LL| 12|extern "C" fn might_abort(should_abort: bool) {

Diff for: tests/coverage/abort.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(c_unwind)]
21
#![allow(unused_assignments)]
32

43
extern "C" fn might_abort(should_abort: bool) {

Diff for: tests/run-make/forced-unwind-terminate-pof/foo.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Tests that forced unwind through POF Rust frames wouldn't trigger our terminating guards.
22

3-
#![feature(c_unwind)]
43
#![no_main]
54

65
extern "C-unwind" {

Diff for: tests/ui/asm/x86_64/may_unwind.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl Drop for Foo<'_> {
1616
}
1717
}
1818

19-
extern "C" fn panicky() {
19+
extern "C-unwind" fn panicky() {
2020
resume_unwind(Box::new(()));
2121
}
2222

Diff for: tests/ui/consts/const-eval/unwind-abort.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(c_unwind, const_extern_fn)]
1+
#![feature(const_extern_fn)]
22

33
const extern "C" fn foo() {
44
panic!() //~ ERROR evaluation of constant value failed

Diff for: tests/ui/consts/unwind-abort.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ check-pass
22

3-
#![feature(c_unwind, const_extern_fn)]
3+
#![feature(const_extern_fn)]
44

55
// We don't unwind in const-eval anyways.
66
const extern "C" fn foo() {

Diff for: tests/ui/panics/abort-on-panic.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
//@[next] compile-flags: -Znext-solver
55

66
#![allow(unused_must_use)]
7-
#![feature(c_unwind)]
87
#![feature(panic_always_abort)]
98
// Since we mark some ABIs as "nounwind" to LLVM, we must make sure that
109
// we never unwind through them.

0 commit comments

Comments
 (0)