Skip to content

Commit

Permalink
Auto merge of rust-lang#114225 - workingjubilee:only-golden-arches, r…
Browse files Browse the repository at this point in the history
…=compiler-errors

Only golden arches

A number of tests in the test suite have applied the somewhat comedic practice of ignoring *every* single target architecture that rustc has ever supported. This is silly, when they are clearly tests built around certain assumptions, primarily of the x86-64 architecture, or in one case when they are only relevant for a handful of 32-bit targets. This has even resulted, in one case, in the same architecture being ignored twice!

Document these better, and use a "revision + only-arch" idiom in the test headers to denote the "golden arches" that actually pass these tests.
  • Loading branch information
bors committed Jul 31, 2023
2 parents 3be07c1 + 20ebbf4 commit 03b8b50
Show file tree
Hide file tree
Showing 17 changed files with 75 additions and 184 deletions.
20 changes: 4 additions & 16 deletions tests/codegen/abi-main-signature-16bit-c-int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,10 @@
// entry point. It must match C's `int main(int, char **)`.

// This test is for targets with 16bit c_int only.
// ignore-aarch64
// ignore-arm
// ignore-asmjs
// ignore-hexagon
// ignore-mips
// ignore-mips64
// ignore-powerpc
// ignore-powerpc64
// ignore-riscv64
// ignore-s390x
// ignore-sparc
// ignore-sparc64
// ignore-wasm32
// ignore-x86
// ignore-x86_64
// ignore-loongarch64
// revisions: avr msp
//[avr] only-avr
//[msp] only-msp430


fn main() {
}
Expand Down
1 change: 1 addition & 0 deletions tests/codegen/abi-main-signature-32bit-c-int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

// This test is for targets with 32bit c_int only.
// ignore-msp430
// ignore-avr

fn main() {
}
Expand Down
24 changes: 3 additions & 21 deletions tests/codegen/global_asm.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
// ignore-aarch64
// ignore-arm
// ignore-avr
// ignore-bpf
// ignore-bpf
// ignore-hexagon
// ignore-mips
// ignore-mips64
// ignore-msp430
// ignore-powerpc64
// ignore-powerpc
// ignore-sparc
// ignore-sparc64
// ignore-s390x
// ignore-thumb
// ignore-nvptx64
// ignore-spirv
// ignore-wasm32
// ignore-wasm64
// ignore-emscripten
// ignore-loongarch64
// revisions: x32 x64
//[x32] only-x86
//[x64] only-x86_64
// compile-flags: -C no-prepopulate-passes

#![crate_type = "lib"]
Expand Down
24 changes: 3 additions & 21 deletions tests/codegen/global_asm_include.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
// ignore-aarch64
// ignore-arm
// ignore-avr
// ignore-bpf
// ignore-bpf
// ignore-hexagon
// ignore-mips
// ignore-mips64
// ignore-msp430
// ignore-powerpc64
// ignore-powerpc
// ignore-sparc
// ignore-sparc64
// ignore-s390x
// ignore-thumb
// ignore-nvptx64
// ignore-spirv
// ignore-wasm32
// ignore-wasm64
// ignore-emscripten
// ignore-loongarch64
// revisions: x32 x64
//[x32] only-x86
//[x64] only-x86_64
// compile-flags: -C no-prepopulate-passes

#![crate_type = "lib"]
Expand Down
24 changes: 3 additions & 21 deletions tests/codegen/global_asm_x2.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
// ignore-aarch64
// ignore-arm
// ignore-avr
// ignore-bpf
// ignore-bpf
// ignore-hexagon
// ignore-mips
// ignore-mips64
// ignore-msp430
// ignore-powerpc64
// ignore-powerpc
// ignore-sparc
// ignore-sparc64
// ignore-s390x
// ignore-thumb
// ignore-nvptx64
// ignore-spirv
// ignore-wasm32
// ignore-wasm64
// ignore-emscripten
// ignore-loongarch64
// revisions: x32 x64
//[x32] only-x86
//[x64] only-x86_64
// compile-flags: -C no-prepopulate-passes

#![crate_type = "lib"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
// revisions: arm mips thumb wasm32
// compile-flags: -C no-prepopulate-passes
//

// ignore-aarch64
//[arm] only-arm
//[mips] only-mips
//[thumb] only-thumb
//[wasm32] only-wasm32
// ignore-emscripten
// ignore-mips64
// ignore-powerpc
// ignore-powerpc64
// ignore-riscv64 see codegen/riscv-abi
// ignore-s390x
// ignore-sparc
// ignore-sparc64
// ignore-x86
// ignore-x86_64
// ignore-loongarch64
// See repr-transparent.rs
// See ./transparent.rs
// Some platforms pass large aggregates using immediate arrays in LLVMIR
// Other platforms pass large aggregates using struct pointer in LLVMIR
// This covers the "immediate array" case.

#![feature(transparent_unions)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//

// only-mips64
// See repr-transparent.rs
// See ./transparent.rs

#![feature(transparent_unions)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
// revisions: x32 x64 sparc sparc64
// compile-flags: -O -C no-prepopulate-passes
//

// ignore-arm
// ignore-aarch64
// ignore-mips
// ignore-mips64
// ignore-powerpc
// ignore-powerpc64
// ignore-riscv64 see codegen/riscv-abi
// ignore-s390x
//[x32] only-x86
//[x64] only-x86_64
//[sparc] only-sparc
//[sparc64] only-sparc64
// ignore-windows
// ignore-loongarch64
// ignore-wasm32-bare
// See repr-transparent.rs
// See ./transparent.rs
// Some platforms pass large aggregates using immediate arrays in LLVMIR
// Other platforms pass large aggregates using struct pointer in LLVMIR
// This covers the "struct pointer" case.


#![feature(transparent_unions)]

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// compile-flags: -O -C no-prepopulate-passes

// ignore-riscv64 riscv64 has an i128 type used with test_Vector
// see codegen/riscv-abi for riscv functiona call tests
// ignore-s390x s390x with default march passes vector types per reference
// ignore-loongarch64 see codegen/loongarch-abi for loongarch function call tests

// This codegen test embeds assumptions about how certain "C" psABIs are handled
// so it doesn't apply to all architectures or even all OS
// For RISCV: see codegen/riscv-abi
// For LoongArch: see codegen/loongarch-abi

#![crate_type="lib"]
#![feature(repr_simd, transparent_unions)]

Expand Down Expand Up @@ -159,7 +162,7 @@ pub union UnionF32WithZsts {
pub extern "C" fn test_UnionF32WithZsts(_: UnionF32WithZsts) -> UnionF32WithZsts { loop {} }


// All that remains to be tested are aggregates. They are tested in separate files called repr-
// All that remains to be tested are aggregates. They are tested in separate files called
// transparent-*.rs with `only-*` or `ignore-*` directives, because the expected LLVM IR
// function signatures vary so much that it's not reasonably possible to cover all of them with a
// single CHECK line.
Expand Down
13 changes: 3 additions & 10 deletions tests/debuginfo/thread-names.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
// compile-flags:-g
// revisions: macos windows
// We can't set the main thread name on Linux because it renames the process (#97191)
// ignore-linux
// ignore-android
// ignore-dragonfly
// ignore-emscripten
// ignore-freebsd
// ignore-haiku
// ignore-ios
// ignore-netbsd
// ignore-openbsd
// ignore-solaris
//[macos] only-macos
//[windows] only-windows
// ignore-sgx
// ignore-windows-gnu

Expand Down
12 changes: 3 additions & 9 deletions tests/ui/abi/stack-probes-lto.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
// revisions: x32 x64
// run-pass
// ignore-arm
// ignore-aarch64
// ignore-mips
// ignore-mips64
// ignore-sparc
// ignore-sparc64
// ignore-loongarch64
// ignore-wasm
// ignore-emscripten no processes
//[x32] only-x86
//[x64] only-x86_64
// ignore-sgx no processes
// ignore-musl FIXME #31506
// ignore-fuchsia no exception handler registered for segfault
Expand Down
11 changes: 3 additions & 8 deletions tests/ui/abi/stack-probes.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
// revisions: x32 x64
// run-pass
// ignore-arm
// ignore-aarch64
// ignore-mips
// ignore-mips64
// ignore-sparc
// ignore-sparc64
// ignore-loongarch64
// ignore-wasm
//[x32] only-x86
//[x64] only-x86_64
// ignore-emscripten no processes
// ignore-sgx no processes
// ignore-fuchsia no exception handler registered for segfault
Expand Down
15 changes: 2 additions & 13 deletions tests/ui/target-feature/gate.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// ignore-arm
// ignore-aarch64
// ignore-wasm
// ignore-emscripten
// ignore-mips
// ignore-mips64
// ignore-powerpc
// ignore-powerpc64
// ignore-riscv64
// ignore-sparc
// ignore-sparc64
// ignore-s390x
// ignore-loongarch64
// only-x86_64
//
// gate-test-sse4a_target_feature
// gate-test-powerpc_target_feature
// gate-test-avx512_target_feature
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/target-feature/gate.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0658]: the target feature `avx512bw` is currently unstable
--> $DIR/gate.rs:32:18
--> $DIR/gate.rs:21:18
|
LL | #[target_feature(enable = "avx512bw")]
| ^^^^^^^^^^^^^^^^^^^
Expand Down
14 changes: 1 addition & 13 deletions tests/ui/target-feature/invalid-attribute.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
// ignore-arm
// ignore-aarch64
// ignore-wasm
// ignore-emscripten
// ignore-mips
// ignore-mips64
// ignore-powerpc
// ignore-powerpc64
// ignore-riscv64
// ignore-s390x
// ignore-sparc
// ignore-sparc64
// ignore-loongarch64
// only-x86_64

#![warn(unused_attributes)]

Expand Down
Loading

0 comments on commit 03b8b50

Please sign in to comment.