@@ -793,11 +793,9 @@ fn collect_tests_from_dir(
793
793
return Ok ( TestCollector :: new ( ) ) ;
794
794
}
795
795
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[ .. ]
798
798
&& let Some ( ( "assembly" | "codegen" , backend) ) = last. split_once ( '-' )
799
- && let Some ( Utf8Component :: Normal ( parent) ) = components. next ( )
800
- && parent == "tests"
801
799
&& let Ok ( backend) = CodegenBackend :: try_from ( backend)
802
800
&& backend != cx. config . default_codegen_backend
803
801
{
@@ -810,6 +808,15 @@ fn collect_tests_from_dir(
810
808
return Ok ( TestCollector :: new ( ) ) ;
811
809
}
812
810
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
+
813
820
// For run-make tests, a "test file" is actually a directory that contains an `rmake.rs`.
814
821
if cx. config . mode == TestMode :: RunMake {
815
822
let mut collector = TestCollector :: new ( ) ;
0 commit comments