File tree 3 files changed +21
-0
lines changed
src/tools/compiletest/src
3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
116
116
"incremental" ,
117
117
"known-bug" ,
118
118
"llvm-cov-flags" ,
119
+ "max-llvm-version" ,
119
120
"min-cdb-version" ,
120
121
"min-gdb-version" ,
121
122
"min-lldb-version" ,
Original file line number Diff line number Diff line change @@ -1501,6 +1501,17 @@ fn ignore_llvm(config: &Config, line: &str) -> IgnoreDecision {
1501
1501
) ,
1502
1502
} ;
1503
1503
}
1504
+ } else if let Some ( value) = config. parse_name_value_directive ( line, "max-llvm-version" ) {
1505
+ let value = value. trim ( ) ;
1506
+ let max_version = extract_llvm_version ( value) . unwrap ( ) ;
1507
+ // Ignore if actual version is larger than the maximum required version.
1508
+ if actual_version > max_version {
1509
+ return IgnoreDecision :: Ignore {
1510
+ reason : format ! (
1511
+ "ignored when the LLVM version ({actual_version}) is newer than {max_version}"
1512
+ ) ,
1513
+ } ;
1514
+ }
1504
1515
} else if let Some ( value) =
1505
1516
config. parse_name_value_directive ( line, "min-system-llvm-version" )
1506
1517
{
Original file line number Diff line number Diff line change @@ -261,6 +261,15 @@ fn llvm_version() {
261
261
262
262
let config: Config = cfg ( ) . llvm_version ( "10.0.0" ) . build ( ) ;
263
263
assert ! ( !check_ignore( & config, "//@ min-llvm-version: 9.0" ) ) ;
264
+
265
+ let config: Config = cfg ( ) . llvm_version ( "20.0.0" ) . build ( ) ;
266
+ assert ! ( check_ignore( & config, "//@ max-llvm-version: 19.3.1" ) ) ;
267
+
268
+ let config: Config = cfg ( ) . llvm_version ( "20.0.0" ) . build ( ) ;
269
+ assert ! ( !check_ignore( & config, "//@ max-llvm-version: 20.0.0" ) ) ;
270
+
271
+ let config: Config = cfg ( ) . llvm_version ( "20.0.0" ) . build ( ) ;
272
+ assert ! ( !check_ignore( & config, "//@ max-llvm-version: 20.0.1" ) ) ;
264
273
}
265
274
266
275
#[ test]
You can’t perform that action at this time.
0 commit comments