@@ -9,7 +9,7 @@ use camino::{Utf8Path, Utf8PathBuf};
99use semver:: Version ;
1010use tracing:: * ;
1111
12- use crate :: common:: { Config , Debugger , FailMode , PassMode , RunFailMode , TestMode } ;
12+ use crate :: common:: { CodegenBackend , Config , Debugger , FailMode , PassMode , RunFailMode , TestMode } ;
1313use crate :: debuggers:: { extract_cdb_version, extract_gdb_version} ;
1414use crate :: directives:: auxiliary:: { AuxProps , parse_and_update_aux} ;
1515use crate :: directives:: needs:: CachedNeedsConditions ;
@@ -818,6 +818,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
818818 "ignore-arm-unknown-linux-musleabihf" ,
819819 "ignore-auxiliary" ,
820820 "ignore-avr" ,
821+ "ignore-backends" ,
821822 "ignore-beta" ,
822823 "ignore-cdb" ,
823824 "ignore-compare-mode-next-solver" ,
@@ -1669,6 +1670,7 @@ pub(crate) fn make_test_description<R: Read>(
16691670 decision ! ( cfg:: handle_only( config, ln) ) ;
16701671 decision ! ( needs:: handle_needs( & cache. needs, config, ln) ) ;
16711672 decision ! ( ignore_llvm( config, path, ln) ) ;
1673+ decision ! ( ignore_backends( config, path, ln) ) ;
16721674 decision ! ( ignore_cdb( config, ln) ) ;
16731675 decision ! ( ignore_gdb( config, ln) ) ;
16741676 decision ! ( ignore_lldb( config, ln) ) ;
@@ -1795,6 +1797,26 @@ fn ignore_lldb(config: &Config, line: &str) -> IgnoreDecision {
17951797 IgnoreDecision :: Continue
17961798}
17971799
1800+ fn ignore_backends ( config : & Config , path : & Utf8Path , line : & str ) -> IgnoreDecision {
1801+ if let Some ( backends_to_ignore) = config. parse_name_value_directive ( line, "ignore-backends" ) {
1802+ for backend in backends_to_ignore. split_whitespace ( ) . map ( |backend| {
1803+ match CodegenBackend :: try_from ( backend) {
1804+ Ok ( backend) => backend,
1805+ Err ( error) => {
1806+ panic ! ( "Invalid ignore-backends value `{backend}` in `{path}`: {error}" )
1807+ }
1808+ }
1809+ } ) {
1810+ if config. codegen_backend == backend {
1811+ return IgnoreDecision :: Ignore {
1812+ reason : format ! ( "{} backend is marked as ignore" , backend. as_str( ) ) ,
1813+ } ;
1814+ }
1815+ }
1816+ }
1817+ IgnoreDecision :: Continue
1818+ }
1819+
17981820fn ignore_llvm ( config : & Config , path : & Utf8Path , line : & str ) -> IgnoreDecision {
17991821 if let Some ( needed_components) =
18001822 config. parse_name_value_directive ( line, "needs-llvm-components" )
0 commit comments