Skip to content

Commit e2f5623

Browse files
committed
compiletest: don't register MSVC/NONMSVC FileCheck prefixes
This was fragile as it was based on host target passed to compiletest, but the user could cross-compile and run test for a different target (e.g. cross from linux to msvc, but msvc won't be set on the target). Furthermore, it was also very surprising as normally revision names (other than `CHECK`) was accepted as FileCheck prefixes.
1 parent 37e7459 commit e2f5623

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

src/tools/compiletest/src/runtest.rs

+3-10
Original file line numberDiff line numberDiff line change
@@ -1958,23 +1958,16 @@ impl<'test> TestCx<'test> {
19581958
let mut filecheck = Command::new(self.config.llvm_filecheck.as_ref().unwrap());
19591959
filecheck.arg("--input-file").arg(output).arg(&self.testpaths.file);
19601960

1961-
// FIXME: Consider making some of these prefix flags opt-in per test,
1962-
// via `filecheck-flags` or by adding new header directives.
1963-
19641961
// Because we use custom prefixes, we also have to register the default prefix.
19651962
filecheck.arg("--check-prefix=CHECK");
19661963

1967-
// Some tests use the current revision name as a check prefix.
1964+
// Tests are allowed to use a revision name as a check prefix.
19681965
if let Some(rev) = self.revision {
19691966
filecheck.arg("--check-prefix").arg(rev);
19701967
}
19711968

1972-
// Some tests also expect either the MSVC or NONMSVC prefix to be defined.
1973-
let msvc_or_not = if self.config.target.contains("msvc") { "MSVC" } else { "NONMSVC" };
1974-
filecheck.arg("--check-prefix").arg(msvc_or_not);
1975-
1976-
// The filecheck tool normally fails if a prefix is defined but not used.
1977-
// However, we define several prefixes globally for all tests.
1969+
// The filecheck tool normally fails if a prefix is defined but not used. However, sometimes
1970+
// revisions are used to specify *compiletest* directives which are not FileCheck concerns.
19781971
filecheck.arg("--allow-unused-prefixes");
19791972

19801973
// Provide more context on failures.

tests/codegen/meta-filecheck/msvc-prefix-good.rs

-7
This file was deleted.

0 commit comments

Comments
 (0)