Skip to content
Draft
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
19 changes: 0 additions & 19 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2071,25 +2071,6 @@ impl<'test> TestCx<'test> {
let mut filecheck = Command::new(self.config.llvm_filecheck.as_ref().unwrap());
filecheck.arg("--input-file").arg(output).arg(&self.testpaths.file);

// Because we use custom prefixes, we also have to register the default prefix.
filecheck.arg("--check-prefix=CHECK");

// FIXME(#134510): auto-registering revision names as check prefix is a bit sketchy, and
// that having to pass `--allow-unused-prefix` is an unfortunate side-effect of not knowing
// whether the test author actually wanted revision-specific check prefixes or not.
//
// TL;DR We may not want to conflate `compiletest` revisions and `FileCheck` prefixes.

// HACK: tests are allowed to use a revision name as a check prefix.
if let Some(rev) = self.revision {
filecheck.arg("--check-prefix").arg(rev);
}

// HACK: the filecheck tool normally fails if a prefix is defined but not used. However,
// sometimes revisions are used to specify *compiletest* directives which are not FileCheck
// concerns.
filecheck.arg("--allow-unused-prefixes");

// Provide more context on failures.
filecheck.args(&["--dump-input-context", "100"]);

Expand Down
3 changes: 3 additions & 0 deletions tests/assembly-llvm/aarch64-pointer-auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
//@ needs-llvm-components: aarch64
//@ compile-flags: --target aarch64-unknown-linux-gnu
//@ [PACRET] compile-flags: -Z branch-protection=pac-ret,leaf
//@ [PACRET] filecheck-flags: --check-prefixes=PACRET
//@ [PAUTHLR_NOP] compile-flags: -Z branch-protection=pac-ret,pc,leaf
//@ [PAUTHLR_NOP] filecheck-flags: --check-prefixes=PAUTHLR_NOP
//@ [PAUTHLR] compile-flags: -C target-feature=+pauth-lr -Z branch-protection=pac-ret,pc,leaf
//@ [PAUTHLR] filecheck-flags: --check-prefixes=PAUTHLR

#![feature(no_core, lang_items)]
#![no_std]
Expand Down
2 changes: 2 additions & 0 deletions tests/assembly-llvm/asm/arm-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//@[d32] compile-flags: -C target-feature=+d32
//@[neon] compile-flags: -C target-feature=+neon --cfg d32
//@[neon] filecheck-flags: --check-prefix d32
//@[d32] filecheck-flags: --check-prefixes=CHECK,d32
//@[neon] filecheck-flags: --check-prefixes=CHECK,neon
//@ needs-llvm-components: arm

#![feature(no_core, repr_simd, f16)]
Expand Down
1 change: 1 addition & 0 deletions tests/assembly-llvm/asm/loongarch-type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

//@[loongarch64] compile-flags: --target loongarch64-unknown-none
//@[loongarch64] needs-llvm-components: loongarch
//@[loongarch64] filecheck-flags: --check-prefixes=CHECK,loongarch64

//@ compile-flags: -Zmerge-functions=disabled

Expand Down
2 changes: 2 additions & 0 deletions tests/assembly-llvm/asm/mips-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
//@[mips32] needs-llvm-components: mips
//@[mips64] compile-flags: --target mips64-unknown-linux-gnuabi64
//@[mips64] needs-llvm-components: mips
//@[mips32] filecheck-flags: --check-prefixes=CHECK,mips32
//@[mips64] filecheck-flags: --check-prefixes=CHECK,mips64
//@ compile-flags: -Zmerge-functions=disabled

#![feature(no_core, asm_experimental_arch)]
Expand Down
4 changes: 4 additions & 0 deletions tests/assembly-llvm/asm/powerpc-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
//@[powerpc] compile-flags: --target powerpc-unknown-linux-gnu
//@[powerpc] needs-llvm-components: powerpc
//@[powerpc_altivec] compile-flags: --target powerpc-unknown-linux-gnu -C target-feature=+altivec --cfg altivec
//@[powerpc_altivec] filecheck-flags: --check-prefixes=CHECK,powerpc_altivec
//@[powerpc_altivec] needs-llvm-components: powerpc
//@[powerpc_vsx] compile-flags: --target powerpc-unknown-linux-gnu -C target-feature=+altivec,+vsx --cfg altivec --cfg vsx
//@[powerpc_vsx] filecheck-flags: --check-prefixes=CHECK,powerpc_vsx
//@[powerpc_vsx] needs-llvm-components: powerpc
//@[powerpc64] compile-flags: --target powerpc64-unknown-linux-gnu --cfg altivec
//@[powerpc64] filecheck-flags: --check-prefixes=CHECK,powerpc64
//@[powerpc64] needs-llvm-components: powerpc
//@[powerpc64_vsx] compile-flags: --target powerpc64-unknown-linux-gnu -C target-feature=+vsx --cfg altivec --cfg vsx
//@[powerpc64_vsx] filecheck-flags: --check-prefixes=CHECK,powerpc64_vsx
//@[powerpc64_vsx] needs-llvm-components: powerpc
//@ compile-flags: -Zmerge-functions=disabled

Expand Down
8 changes: 5 additions & 3 deletions tests/assembly-llvm/asm/riscv-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,30 @@

//@[riscv64] compile-flags: --target riscv64imac-unknown-none-elf
//@[riscv64] needs-llvm-components: riscv
//@[riscv64] filecheck-flags: --check-prefixes=CHECK,riscv64

//@[riscv32] compile-flags: --target riscv32imac-unknown-none-elf
//@[riscv32] needs-llvm-components: riscv

//@[riscv64-zfhmin] compile-flags: --target riscv64imac-unknown-none-elf --cfg riscv64
//@[riscv64-zfhmin] needs-llvm-components: riscv
//@[riscv64-zfhmin] compile-flags: -C target-feature=+zfhmin
//@[riscv64-zfhmin] filecheck-flags: --check-prefix riscv64
//@[riscv64-zfhmin] filecheck-flags: --check-prefixes=CHECK,riscv64

//@[riscv32-zfhmin] compile-flags: --target riscv32imac-unknown-none-elf
//@[riscv32-zfhmin] needs-llvm-components: riscv
//@[riscv32-zfhmin] compile-flags: -C target-feature=+zfhmin
//@[riscv32-zfhmin] filecheck-flags: --check-prefixes=CHECK,zfhmin

//@[riscv64-zfh] compile-flags: --target riscv64imac-unknown-none-elf --cfg riscv64
//@[riscv64-zfh] needs-llvm-components: riscv
//@[riscv64-zfh] compile-flags: -C target-feature=+zfh
//@[riscv64-zfh] filecheck-flags: --check-prefix riscv64 --check-prefix zfhmin
//@[riscv64-zfh] filecheck-flags: --check-prefixes=CHECK,riscv64 --check-prefix zfhmin

//@[riscv32-zfh] compile-flags: --target riscv32imac-unknown-none-elf
//@[riscv32-zfh] needs-llvm-components: riscv
//@[riscv32-zfh] compile-flags: -C target-feature=+zfh
//@[riscv32-zfh] filecheck-flags: --check-prefix zfhmin
//@[riscv32-zfh] filecheck-flags: --check-prefixes=CHECK,zfhmin

//@ compile-flags: -C target-feature=+d
//@ compile-flags: -Zmerge-functions=disabled
Expand Down
1 change: 1 addition & 0 deletions tests/assembly-llvm/asm/s390x-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//@[s390x] needs-llvm-components: systemz
//@[s390x_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-feature=+vector
//@[s390x_vector] needs-llvm-components: systemz
//@[s390x_vector] filecheck-flags: --check-prefixes=CHECK,s390x_vector
//@ compile-flags: -Zmerge-functions=disabled

#![feature(no_core, repr_simd, f128)]
Expand Down
1 change: 1 addition & 0 deletions tests/assembly-llvm/asm/sparc-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//@[sparcv8plus] needs-llvm-components: sparc
//@[sparc64] compile-flags: --target sparc64-unknown-linux-gnu
//@[sparc64] needs-llvm-components: sparc
//@[sparc64] filecheck-flags: --check-prefixes=CHECK,sparc64
//@ compile-flags: -Zmerge-functions=disabled

#![feature(no_core, asm_experimental_arch)]
Expand Down
2 changes: 2 additions & 0 deletions tests/assembly-llvm/asm/x86-modifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//@[x86_64] needs-llvm-components: x86
//@[i686] compile-flags: --target i686-unknown-linux-gnu
//@[i686] needs-llvm-components: x86
//@[x86_64] filecheck-flags: --check-prefixes=CHECK,x86_64
//@[i686] filecheck-flags: --check-prefixes=CHECK,i686
//@ compile-flags: -C llvm-args=--x86-asm-syntax=intel
//@ compile-flags: -C target-feature=+avx512bw
//@ compile-flags: -Zmerge-functions=disabled
Expand Down
2 changes: 2 additions & 0 deletions tests/assembly-llvm/asm/x86-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
//@[x86_64] needs-llvm-components: x86
//@[i686] compile-flags: --target i686-unknown-linux-gnu
//@[i686] needs-llvm-components: x86
//@[x86_64] filecheck-flags: --check-prefixes=CHECK,x86_64
//@[i686] filecheck-flags: --check-prefixes=CHECK,i686
//@ compile-flags: -C llvm-args=--x86-asm-syntax=intel
//@ compile-flags: -C target-feature=+avx512bw
//@ compile-flags: -Zmerge-functions=disabled
Expand Down
2 changes: 2 additions & 0 deletions tests/assembly-llvm/nvptx-safe-naming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//@ revisions: LLVM20 LLVM21
//@ [LLVM21] min-llvm-version: 21
//@ [LLVM20] max-llvm-major-version: 20
//@ [LLVM21] filecheck-flags: --check-prefixes=CHECK,LLVM21
//@ [LLVM20] filecheck-flags: --check-prefixes=CHECK,LLVM20

#![feature(abi_ptx)]
#![no_std]
Expand Down
9 changes: 4 additions & 5 deletions tests/assembly-llvm/powerpc64-struct-abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
//@ assembly-output: emit-asm
//@ compile-flags: -Copt-level=3
//@[elfv1-be] compile-flags: --target powerpc64-unknown-linux-gnu
//@[elfv1-be] filecheck-flags: --check-prefixes=CHECK,elfv1-be,be,elf
//@[elfv1-be] needs-llvm-components: powerpc
//@[elfv2-be] compile-flags: --target powerpc64-unknown-linux-musl
//@[elfv2-be] filecheck-flags: --check-prefixes=CHECK,elfv2-be,be,elf
//@[elfv2-be] needs-llvm-components: powerpc
//@[elfv2-le] compile-flags: --target powerpc64le-unknown-linux-gnu -C target-cpu=pwr8
//@[elfv2-le] filecheck-flags: --check-prefixes=CHECK,elfv2-le,elf
//@[elfv2-le] needs-llvm-components: powerpc
//@[aix] compile-flags: --target powerpc64-ibm-aix
//@[aix] filecheck-flags: --check-prefixes=CHECK,aix
//@[aix] needs-llvm-components: powerpc
//@[elfv1-be] filecheck-flags: --check-prefix be
//@[elfv2-be] filecheck-flags: --check-prefix be
//@[elfv1-be] filecheck-flags: --check-prefix elf
//@[elfv2-be] filecheck-flags: --check-prefix elf
//@[elfv2-le] filecheck-flags: --check-prefix elf

#![feature(no_core, lang_items)]
#![no_std]
Expand Down
2 changes: 2 additions & 0 deletions tests/assembly-llvm/riscv-soft-abi-with-float-features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
//@ revisions: LLVM-PRE-20 LLVM-POST-20
//@ [LLVM-PRE-20] max-llvm-major-version: 19
//@ [LLVM-POST-20] min-llvm-version: 20
//@ [LLVM-PRE-20] filecheck-flags: --check-prefixes=CHECK,LLVM-PRE-20
//@ [LLVM-POST-20] filecheck-flags: --check-prefixes=CHECK,LLVM-POST-20

#![feature(no_core, lang_items, f16)]
#![crate_type = "lib"]
Expand Down
3 changes: 3 additions & 0 deletions tests/assembly-llvm/rust-abi-arg-attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
//@ [riscv64-zbb] needs-llvm-components: riscv
//@ [loongarch64] compile-flags: --target loongarch64-unknown-linux-gnu
//@ [loongarch64] needs-llvm-components: loongarch
//@ [riscv64] filecheck-flags: --check-prefixes=CHECK,riscv64
//@ [riscv64-zbb] filecheck-flags: --check-prefixes=CHECK,riscv64-zbb
//@ [loongarch64] filecheck-flags: --check-prefixes=CHECK,loongarch64

#![feature(no_core, lang_items, intrinsics, rustc_attrs)]
#![crate_type = "lib"]
Expand Down
3 changes: 3 additions & 0 deletions tests/assembly-llvm/s390x-backchain-toggle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
//@ needs-llvm-components: systemz
//@[enable-backchain] compile-flags: -Ctarget-feature=+backchain
//@[disable-backchain] compile-flags: -Ctarget-feature=-backchain
//@[enable-backchain] filecheck-flags: --check-prefixes=CHECK,enable-backchain
//@[disable-backchain] filecheck-flags: --check-prefixes=CHECK,disable-backchain

#![feature(no_core, lang_items)]
#![no_std]
#![no_core]
Expand Down
2 changes: 2 additions & 0 deletions tests/assembly-llvm/s390x-vector-abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
//@ assembly-output: emit-asm
//@ compile-flags: -Copt-level=3 -Z merge-functions=disabled
//@[z10] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z10 --cfg no_vector
//@[z10] filecheck-flags: --check-prefixes=CHECK,z10
//@[z10] needs-llvm-components: systemz
//@[z10_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z10 -C target-feature=+vector
//@[z10_vector] needs-llvm-components: systemz
//@[z13] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13
//@[z13] filecheck-flags: --check-prefixes=CHECK,z13
//@[z13] needs-llvm-components: systemz
//@[z13_no_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector --cfg no_vector
//@[z13_no_vector] needs-llvm-components: systemz
Expand Down
4 changes: 4 additions & 0 deletions tests/assembly-llvm/simd-bitmask.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
//@ add-core-stubs
//@ revisions: x86 x86-avx2 x86-avx512 aarch64
//@ [x86] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
//@ [x86] filecheck-flags: --check-prefixes=CHECK,x86
//@ [x86] needs-llvm-components: x86
//@ [x86-avx2] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
//@ [x86-avx2] compile-flags: -C target-feature=+avx2
//@ [x86-avx2] filecheck-flags: --check-prefixes=CHECK,x86-avx2
//@ [x86-avx2] needs-llvm-components: x86
//@ [x86-avx512] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
//@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
//@ [x86-avx512] filecheck-flags: --check-prefixes=CHECK,x86-avx512
//@ [x86-avx512] needs-llvm-components: x86
//@ [aarch64] compile-flags: --target=aarch64-unknown-linux-gnu
//@ [aarch64] filecheck-flags: --check-prefixes=CHECK,aarch64
//@ [aarch64] needs-llvm-components: aarch64
//@ assembly-output: emit-asm
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort
Expand Down
1 change: 1 addition & 0 deletions tests/assembly-llvm/simd-intrinsic-gather.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//@ [x86-avx512] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
//@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
//@ [x86-avx512] needs-llvm-components: x86
//@ [x86-avx512] filecheck-flags: --check-prefixes=CHECK,x86-avx512
//@ assembly-output: emit-asm
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort

Expand Down
2 changes: 2 additions & 0 deletions tests/assembly-llvm/simd-intrinsic-mask-load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
//@ revisions: x86-avx2 x86-avx512
//@ [x86-avx2] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
//@ [x86-avx2] compile-flags: -C target-feature=+avx2
//@ [x86-avx2] filecheck-flags: --check-prefixes=CHECK,x86-avx2
//@ [x86-avx2] needs-llvm-components: x86
//@ [x86-avx512] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
//@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
//@ [x86-avx512] filecheck-flags: --check-prefixes=CHECK,x86-avx512
//@ [x86-avx512] needs-llvm-components: x86
//@ assembly-output: emit-asm
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort
Expand Down
2 changes: 2 additions & 0 deletions tests/assembly-llvm/simd-intrinsic-mask-reduce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
//@ [x86] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
// Set the base cpu explicitly, in case the default has been changed.
//@ [x86] compile-flags: -C target-cpu=x86-64
//@ [x86] filecheck-flags: --check-prefixes=CHECK,x86
//@ [x86] needs-llvm-components: x86
//@ [aarch64] compile-flags: --target=aarch64-unknown-linux-gnu
//@ [aarch64] filecheck-flags: --check-prefixes=CHECK,aarch64
//@ [aarch64] needs-llvm-components: aarch64
//@ assembly-output: emit-asm
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort
Expand Down
2 changes: 2 additions & 0 deletions tests/assembly-llvm/simd-intrinsic-mask-store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
//@ [x86-avx2] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
//@ [x86-avx2] compile-flags: -C target-feature=+avx2
//@ [x86-avx2] needs-llvm-components: x86
//@ [x86-avx2] filecheck-flags: --check-prefixes=CHECK,x86-avx2
//@ [x86-avx512] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
//@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
//@ [x86-avx512] needs-llvm-components: x86
//@ [x86-avx512] filecheck-flags: --check-prefixes=CHECK,x86-avx512
//@ assembly-output: emit-asm
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort

Expand Down
1 change: 1 addition & 0 deletions tests/assembly-llvm/simd-intrinsic-scatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//@ [x86-avx512] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
//@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
//@ [x86-avx512] needs-llvm-components: x86
//@ [x86-avx512] filecheck-flags: --check-prefixes=CHECK,x86-avx512
//@ assembly-output: emit-asm
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort

Expand Down
3 changes: 3 additions & 0 deletions tests/assembly-llvm/simd-intrinsic-select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
//@ [x86-avx512] needs-llvm-components: x86
//@ [aarch64] compile-flags: --target=aarch64-unknown-linux-gnu
//@ [aarch64] needs-llvm-components: aarch64
//@ [x86-avx2] filecheck-flags: --check-prefixes=CHECK,x86-avx2
//@ [x86-avx512] filecheck-flags: --check-prefixes=CHECK,x86-avx512
//@ [aarch64] filecheck-flags: --check-prefixes=CHECK,aarch64
//@ assembly-output: emit-asm
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort

Expand Down
3 changes: 3 additions & 0 deletions tests/assembly-llvm/simd/reduce-fadd-unordered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
//@[aarch64] only-aarch64
//@[x86_64] only-x86_64
//@[x86_64] compile-flags: -Ctarget-feature=+sse3
//@[aarch64] filecheck-flags: --check-prefixes=CHECK,aarch64
//@[x86_64] filecheck-flags: --check-prefixes=CHECK,x86_64
//@ ignore-sgx Test incompatible with LVI mitigations

#![feature(portable_simd)]
#![feature(core_intrinsics)]
use std::intrinsics::simd as intrinsics;
Expand Down
3 changes: 3 additions & 0 deletions tests/assembly-llvm/static-relocation-model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
//@ [A64] needs-llvm-components: aarch64
//@ [ppc64le] compile-flags: --target powerpc64le-unknown-linux-gnu -Crelocation-model=static
//@ [ppc64le] needs-llvm-components: powerpc
//@ [x64] filecheck-flags: --check-prefixes=CHECK,x64
//@ [A64] filecheck-flags: --check-prefixes=CHECK,A64
//@ [ppc64le] filecheck-flags: --check-prefixes=CHECK,ppc64le

#![feature(no_core, lang_items)]
#![no_core]
Expand Down
2 changes: 2 additions & 0 deletions tests/assembly-llvm/x86-return-float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
//@[win] needs-llvm-components: x86
//@[linux] compile-flags: --target i686-unknown-linux-gnu
//@[win] compile-flags: --target i686-pc-windows-msvc
//@[linux] filecheck-flags: --check-prefixes=CHECK,linux
//@[win] filecheck-flags: --check-prefixes=CHECK,win

#![crate_type = "lib"]
#![feature(f16, f128)]
Expand Down
2 changes: 2 additions & 0 deletions tests/assembly-llvm/x86_64-windows-i128-abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//@[msvc] needs-llvm-components: x86
//@[softfloat] compile-flags: --target x86_64-unknown-uefi
//@[softfloat] needs-llvm-components: x86
//@[msvc] filecheck-flags: --check-prefixes=CHECK,msvc
//@[softfloat] filecheck-flags: --check-prefixes=CHECK,softfloat

#![feature(no_core)]
#![no_core]
Expand Down
19 changes: 10 additions & 9 deletions tests/codegen-llvm/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
The files here use the LLVM FileCheck framework, documented at
<https://llvm.org/docs/CommandGuide/FileCheck.html>.

One extension worth noting is the use of revisions as custom prefixes for
FileCheck. If your codegen test has different behavior based on the chosen
target or different compiler flags that you want to exercise, you can use a
revisions annotation, like so:
If your codegen test has different behavior based on the chosen target or
different compiler flags that you want to exercise, you can set different
filecheck prefixes for each revision:

```rust
// revisions: aaa bbb
// [bbb] compile-flags: --flags-for-bbb
// [aaa] filecheck-flags: --check-prefixes=ALL,AAA
// [bbb] filecheck-flags: --check-prefixes=ALL,BBB
```

After specifying those variations, you can write different expected, or
explicitly *unexpected* output by using `<prefix>-SAME:` and `<prefix>-NOT:`,
like so:

```rust
// CHECK: expected code
// aaa-SAME: emitted-only-for-aaa
// aaa-NOT: emitted-only-for-bbb
// bbb-NOT: emitted-only-for-aaa
// bbb-SAME: emitted-only-for-bbb
// ALL: expected code
// AAA-SAME: emitted-only-for-aaa
// AAA-NOT: emitted-only-for-bbb
// BBB-NOT: emitted-only-for-aaa
// BBB-SAME: emitted-only-for-bbb
```
3 changes: 3 additions & 0 deletions tests/codegen-llvm/aarch64-struct-align-128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
//@[linux] compile-flags: --target aarch64-unknown-linux-gnu
//@[darwin] compile-flags: --target aarch64-apple-darwin
//@[win] compile-flags: --target aarch64-pc-windows-msvc
//@[linux] filecheck-flags: --check-prefixes=linux
//@[darwin] filecheck-flags: --check-prefixes=darwin
//@[win] filecheck-flags: --check-prefixes=win
//@[linux] needs-llvm-components: aarch64
//@[darwin] needs-llvm-components: aarch64
//@[win] needs-llvm-components: aarch64
Expand Down
Loading
Loading