@@ -9,7 +9,7 @@ use camino::{Utf8Path, Utf8PathBuf};
99use semver:: Version ;
1010use tracing:: * ;
1111
12- use crate :: common:: { Config , Debugger , FailMode , PassMode , TestMode } ;
12+ use crate :: common:: { CodegenBackend , Config , Debugger , FailMode , PassMode , TestMode } ;
1313use crate :: debuggers:: { extract_cdb_version, extract_gdb_version} ;
1414use crate :: directives:: auxiliary:: { AuxProps , parse_and_update_aux} ;
1515use crate :: directives:: needs:: CachedNeedsConditions ;
@@ -812,6 +812,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
812812 "ignore-arm-unknown-linux-musleabihf" ,
813813 "ignore-auxiliary" ,
814814 "ignore-avr" ,
815+ "ignore-backends" ,
815816 "ignore-beta" ,
816817 "ignore-cdb" ,
817818 "ignore-compare-mode-next-solver" ,
@@ -1661,6 +1662,7 @@ pub(crate) fn make_test_description<R: Read>(
16611662 decision ! ( cfg:: handle_only( config, ln) ) ;
16621663 decision ! ( needs:: handle_needs( & cache. needs, config, ln) ) ;
16631664 decision ! ( ignore_llvm( config, path, ln) ) ;
1665+ decision ! ( ignore_backends( config, path, ln) ) ;
16641666 decision ! ( ignore_cdb( config, ln) ) ;
16651667 decision ! ( ignore_gdb( config, ln) ) ;
16661668 decision ! ( ignore_lldb( config, ln) ) ;
@@ -1787,6 +1789,26 @@ fn ignore_lldb(config: &Config, line: &str) -> IgnoreDecision {
17871789 IgnoreDecision :: Continue
17881790}
17891791
1792+ fn ignore_backends ( config : & Config , path : & Utf8Path , line : & str ) -> IgnoreDecision {
1793+ if let Some ( backends_to_ignore) = config. parse_name_value_directive ( line, "ignore-backends" ) {
1794+ for backend in backends_to_ignore. split_whitespace ( ) . map ( |backend| {
1795+ match CodegenBackend :: try_from ( backend) {
1796+ Ok ( backend) => backend,
1797+ Err ( error) => {
1798+ panic ! ( "Invalid ignore-backends value `{backend}` in `{path}`: {error}" )
1799+ }
1800+ }
1801+ } ) {
1802+ if config. codegen_backend == backend {
1803+ return IgnoreDecision :: Ignore {
1804+ reason : format ! ( "{} backend is marked as ignore" , backend. as_str( ) ) ,
1805+ } ;
1806+ }
1807+ }
1808+ }
1809+ IgnoreDecision :: Continue
1810+ }
1811+
17901812fn ignore_llvm ( config : & Config , path : & Utf8Path , line : & str ) -> IgnoreDecision {
17911813 if let Some ( needed_components) =
17921814 config. parse_name_value_directive ( line, "needs-llvm-components" )
0 commit comments