Open mati865 opened 1 week ago
@rustbot modify labels: +A-compiletest
I'll double-check the target matchers, matching on a substring seems somewhat sus here.
I had tried that with quite dusted branch, so maybe it has changed since then. I'll try with a recent master.
Yeah, that's right. On top of 2dece5bb
commit, modifying the test to use:
//@ only-windows
//@ ignore-windows-gnu
shows test [codegen] tests\codegen\cfguard-checks.rs ... ignored, ignored when the operating system and target environment are windows-gnu
.
It's matched because this matcher https://github.com/rust-lang/rust/blob/db034cee00570a9b82ea8b9e9e95221dbd745698/src/tools/compiletest/src/header/cfg.rs#L123-L127 checks os and env but ignores abi which has its own matcher. In this case we'd need a way to somehow combine those two and ignore the test when they are both set to specific (sometimes empty) values.
Currently, supported syntax is too limited to handle that, so fixing this issue is not possible without complicating or reworking how compiletest works. Few ideas that come into mind:
//@ ignore-windows-gnu && ignore-\0
(I've written empty abi as null character)@// ignore-os_env_abi-windows-gnu
or @// ignore-arch_abi-arm-eabi
could allow flexible composition
If I write:
Then gnullvm will be also excluded. There are few things (like CFGuad) that will probably never work with mingw-w64+GNU targets but are supported on mingw-w64+LLVM (not yet within Rust). Using
//@ only-windows-gnullvm
won't be an option because it would disable the test for*-windows-msvc
.One idea I can think of is to add
$
character that means end of the line, just like in regex. So//@ ignore-windows-gnu$
would skip all*-windows-gnu
targets from the given test but keep*-windows-gnullvm
targets.Originally posted by @mati865 in #128602 cc @jieyouxu