File tree 3 files changed +24
-0
lines changed
src/tools/compiletest/src
3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
120
120
"incremental" ,
121
121
"known-bug" ,
122
122
"llvm-cov-flags" ,
123
+ "max-llvm-major-version" ,
123
124
"min-cdb-version" ,
124
125
"min-gdb-version" ,
125
126
"min-lldb-version" ,
Original file line number Diff line number Diff line change @@ -1546,6 +1546,20 @@ fn ignore_llvm(config: &Config, line: &str) -> IgnoreDecision {
1546
1546
) ,
1547
1547
} ;
1548
1548
}
1549
+ } else if let Some ( version_string) =
1550
+ config. parse_name_value_directive ( line, "max-llvm-major-version" )
1551
+ {
1552
+ let max_version = extract_llvm_version ( & version_string) ;
1553
+ // Ignore if actual major version is larger than the maximum required major version.
1554
+ if actual_version. major > max_version. major {
1555
+ return IgnoreDecision :: Ignore {
1556
+ reason : format ! (
1557
+ "ignored when the LLVM version ({actual_version}) is newer than major\
1558
+ version {}",
1559
+ max_version. major
1560
+ ) ,
1561
+ } ;
1562
+ }
1549
1563
} else if let Some ( version_string) =
1550
1564
config. parse_name_value_directive ( line, "min-system-llvm-version" )
1551
1565
{
Original file line number Diff line number Diff line change @@ -299,6 +299,15 @@ fn llvm_version() {
299
299
300
300
let config: Config = cfg ( ) . llvm_version ( "10.6.2" ) . build ( ) ;
301
301
assert ! ( !check_ignore( & config, "//@ exact-llvm-major-version: 10" ) ) ;
302
+
303
+ let config: Config = cfg ( ) . llvm_version ( "19.0.0" ) . build ( ) ;
304
+ assert ! ( !check_ignore( & config, "//@ max-llvm-major-version: 19" ) ) ;
305
+
306
+ let config: Config = cfg ( ) . llvm_version ( "19.1.2" ) . build ( ) ;
307
+ assert ! ( !check_ignore( & config, "//@ max-llvm-major-version: 19" ) ) ;
308
+
309
+ let config: Config = cfg ( ) . llvm_version ( "20.0.0" ) . build ( ) ;
310
+ assert ! ( check_ignore( & config, "//@ max-llvm-major-version: 19" ) ) ;
302
311
}
303
312
304
313
#[ test]
You can’t perform that action at this time.
0 commit comments