Skip to content

Commit ee9ff3c

Browse files
Ignore tests in tests/ui/abi for the GCC backend
1 parent 2f4dfc7 commit ee9ff3c

File tree

1 file changed

+11
-4
lines changed
  • src/tools/compiletest/src

1 file changed

+11
-4
lines changed

src/tools/compiletest/src/lib.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -793,11 +793,9 @@ fn collect_tests_from_dir(
793793
return Ok(TestCollector::new());
794794
}
795795

796-
let mut components = dir.components().rev();
797-
if let Some(Utf8Component::Normal(last)) = components.next()
796+
let components = dir.components().collect::<Vec<_>>();
797+
if let [.., Utf8Component::Normal("tests"), Utf8Component::Normal(last)] = &components[..]
798798
&& let Some(("assembly" | "codegen", backend)) = last.split_once('-')
799-
&& let Some(Utf8Component::Normal(parent)) = components.next()
800-
&& parent == "tests"
801799
&& let Ok(backend) = CodegenBackend::try_from(backend)
802800
&& backend != cx.config.default_codegen_backend
803801
{
@@ -810,6 +808,15 @@ fn collect_tests_from_dir(
810808
return Ok(TestCollector::new());
811809
}
812810

811+
// FIXME: `tests/ui/abi` are not working with the GCC backend currently so we exclude them.
812+
if cx.config.mode == TestMode::Ui
813+
&& cx.config.default_codegen_backend == CodegenBackend::Gcc
814+
&& let [.., Utf8Component::Normal("tests"), Utf8Component::Normal("ui"), Utf8Component::Normal("abi")] = &components[..]
815+
{
816+
warning!("Ignore tests in `{dir}` because they fail with the GCC backend");
817+
return Ok(TestCollector::new());
818+
}
819+
813820
// For run-make tests, a "test file" is actually a directory that contains an `rmake.rs`.
814821
if cx.config.mode == TestMode::RunMake {
815822
let mut collector = TestCollector::new();

0 commit comments

Comments
 (0)