about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-05 16:15:25 +0000
committerbors <bors@rust-lang.org>2023-04-05 16:15:25 +0000
commitb2b676d886ded452125712a304c524c08360f916 (patch)
treef5d8387c269019e423621c1b16b03b1c16e956d4 /tests/codegen
parent4cb92cc83ac6b24d83f8a30763b276cadb8dc41d (diff)
parentbbcbb6fccee0bc9edd7f4da96426d33a1742687d (diff)
Auto merge of #108905 - ferrocene:pa-compiletest-ignore, r=ehuss
Validate `ignore` and `only` compiletest directive, and add human-readable ignore reasons

This PR adds strict validation for the `ignore` and `only` compiletest directives, failing if an unknown value is provided to them. Doing so uncovered 79 tests in `tests/ui` that had invalid directives, so this PR also fixes them.

Finally, this PR adds human-readable ignore reasons when tests are ignored due to `ignore` or `only` directives, like *"only executed when the architecture is aarch64"* or *"ignored when the operative system is windows"*. This was the original reason why I started working on this PR and #108659, as we need both of them for Ferrocene.

The PR is a draft because the code is extremely inefficient: it calls `rustc --print=cfg --target $target` for every rustc target (to gather the list of allowed ignore values), which on my system takes between 4s and 5s, and performs a lot of allocations of constant values. I'll fix both of them in the coming days.

r? `@ehuss`
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/abi-main-signature-16bit-c-int.rs1
-rw-r--r--tests/codegen/global_asm.rs27
-rw-r--r--tests/codegen/global_asm_include.rs27
-rw-r--r--tests/codegen/global_asm_x2.rs27
-rw-r--r--tests/codegen/issues/issue-37945.rs6
-rw-r--r--tests/codegen/repr-transparent-aggregates-2.rs1
6 files changed, 13 insertions, 76 deletions
diff --git a/tests/codegen/abi-main-signature-16bit-c-int.rs b/tests/codegen/abi-main-signature-16bit-c-int.rs
index 4ed491dfb2b..3548cc06a5b 100644
--- a/tests/codegen/abi-main-signature-16bit-c-int.rs
+++ b/tests/codegen/abi-main-signature-16bit-c-int.rs
@@ -17,7 +17,6 @@
 // ignore-wasm32
 // ignore-x86
 // ignore-x86_64
-// ignore-xcore
 
 fn main() {
 }
diff --git a/tests/codegen/global_asm.rs b/tests/codegen/global_asm.rs
index fab84868fdf..9912b1e75bf 100644
--- a/tests/codegen/global_asm.rs
+++ b/tests/codegen/global_asm.rs
@@ -1,39 +1,20 @@
 // ignore-aarch64
-// ignore-aarch64_be
 // ignore-arm
-// ignore-armeb
 // ignore-avr
-// ignore-bpfel
-// ignore-bpfeb
+// ignore-bpf
+// ignore-bpf
 // ignore-hexagon
 // ignore-mips
 // ignore-mips64
 // ignore-msp430
 // ignore-powerpc64
-// ignore-powerpc64le
 // ignore-powerpc
-// ignore-r600
-// ignore-amdgcn
 // ignore-sparc
-// ignore-sparcv9
-// ignore-sparcel
+// ignore-sparc64
 // ignore-s390x
-// ignore-tce
 // ignore-thumb
-// ignore-thumbeb
-// ignore-xcore
-// ignore-nvptx
 // ignore-nvptx64
-// ignore-le32
-// ignore-le64
-// ignore-amdil
-// ignore-amdil64
-// ignore-hsail
-// ignore-hsail64
-// ignore-spir
-// ignore-spir64
-// ignore-kalimba
-// ignore-shave
+// ignore-spirv
 // ignore-wasm32
 // ignore-wasm64
 // ignore-emscripten
diff --git a/tests/codegen/global_asm_include.rs b/tests/codegen/global_asm_include.rs
index 02ee916458f..b68c5ad3b9d 100644
--- a/tests/codegen/global_asm_include.rs
+++ b/tests/codegen/global_asm_include.rs
@@ -1,39 +1,20 @@
 // ignore-aarch64
-// ignore-aarch64_be
 // ignore-arm
-// ignore-armeb
 // ignore-avr
-// ignore-bpfel
-// ignore-bpfeb
+// ignore-bpf
+// ignore-bpf
 // ignore-hexagon
 // ignore-mips
 // ignore-mips64
 // ignore-msp430
 // ignore-powerpc64
-// ignore-powerpc64le
 // ignore-powerpc
-// ignore-r600
-// ignore-amdgcn
 // ignore-sparc
-// ignore-sparcv9
-// ignore-sparcel
+// ignore-sparc64
 // ignore-s390x
-// ignore-tce
 // ignore-thumb
-// ignore-thumbeb
-// ignore-xcore
-// ignore-nvptx
 // ignore-nvptx64
-// ignore-le32
-// ignore-le64
-// ignore-amdil
-// ignore-amdil64
-// ignore-hsail
-// ignore-hsail64
-// ignore-spir
-// ignore-spir64
-// ignore-kalimba
-// ignore-shave
+// ignore-spirv
 // ignore-wasm32
 // ignore-wasm64
 // ignore-emscripten
diff --git a/tests/codegen/global_asm_x2.rs b/tests/codegen/global_asm_x2.rs
index bdcf0ea843c..d87e02befb9 100644
--- a/tests/codegen/global_asm_x2.rs
+++ b/tests/codegen/global_asm_x2.rs
@@ -1,39 +1,20 @@
 // ignore-aarch64
-// ignore-aarch64_be
 // ignore-arm
-// ignore-armeb
 // ignore-avr
-// ignore-bpfel
-// ignore-bpfeb
+// ignore-bpf
+// ignore-bpf
 // ignore-hexagon
 // ignore-mips
 // ignore-mips64
 // ignore-msp430
 // ignore-powerpc64
-// ignore-powerpc64le
 // ignore-powerpc
-// ignore-r600
-// ignore-amdgcn
 // ignore-sparc
-// ignore-sparcv9
-// ignore-sparcel
+// ignore-sparc64
 // ignore-s390x
-// ignore-tce
 // ignore-thumb
-// ignore-thumbeb
-// ignore-xcore
-// ignore-nvptx
 // ignore-nvptx64
-// ignore-le32
-// ignore-le64
-// ignore-amdil
-// ignore-amdil64
-// ignore-hsail
-// ignore-hsail64
-// ignore-spir
-// ignore-spir64
-// ignore-kalimba
-// ignore-shave
+// ignore-spirv
 // ignore-wasm32
 // ignore-wasm64
 // ignore-emscripten
diff --git a/tests/codegen/issues/issue-37945.rs b/tests/codegen/issues/issue-37945.rs
index 19e7e8b1f6e..4f386d335c7 100644
--- a/tests/codegen/issues/issue-37945.rs
+++ b/tests/codegen/issues/issue-37945.rs
@@ -1,9 +1,5 @@
 // compile-flags: -O -Zmerge-functions=disabled
-// ignore-x86
-// ignore-arm
-// ignore-emscripten
-// ignore-gnux32
-// ignore 32-bit platforms (LLVM has a bug with them)
+// ignore-32bit LLVM has a bug with them
 // ignore-debug
 
 // Check that LLVM understands that `Iter` pointer is not null. Issue #37945.
diff --git a/tests/codegen/repr-transparent-aggregates-2.rs b/tests/codegen/repr-transparent-aggregates-2.rs
index df7e88f08c7..e9fa5143b18 100644
--- a/tests/codegen/repr-transparent-aggregates-2.rs
+++ b/tests/codegen/repr-transparent-aggregates-2.rs
@@ -6,7 +6,6 @@
 // ignore-mips64
 // ignore-powerpc
 // ignore-powerpc64
-// ignore-powerpc64le
 // ignore-riscv64 see codegen/riscv-abi
 // ignore-s390x
 // ignore-sparc