File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
166
166
"needs-subprocess" ,
167
167
"needs-symlink" ,
168
168
"needs-target-has-atomic" ,
169
+ "needs-target-std" ,
169
170
"needs-threads" ,
170
171
"needs-unwind" ,
171
172
"needs-wasmtime" ,
Original file line number Diff line number Diff line change @@ -174,6 +174,11 @@ pub(super) fn handle_needs(
174
174
condition : config. with_std_debug_assertions ,
175
175
ignore_reason : "ignored if std wasn't built with debug assertions" ,
176
176
} ,
177
+ Need {
178
+ name : "needs-target-std" ,
179
+ condition : build_helper:: targets:: target_supports_std ( & config. target ) ,
180
+ ignore_reason : "ignored if target does not support std" ,
181
+ } ,
177
182
] ;
178
183
179
184
let ( name, rest) = match ln. split_once ( [ ':' , ' ' ] ) {
Original file line number Diff line number Diff line change @@ -945,3 +945,14 @@ fn test_ignore_auxiliary() {
945
945
let config = cfg ( ) . build ( ) ;
946
946
assert ! ( check_ignore( & config, "//@ ignore-auxiliary" ) ) ;
947
947
}
948
+
949
+ #[ test]
950
+ fn test_needs_target_std ( ) {
951
+ // Cherry-picks two targets:
952
+ // 1. `x86_64-unknown-none`: Tier 2, intentionally never supports std.
953
+ // 2. `x86_64-unknown-linux-gnu`: Tier 1, always supports std.
954
+ let config = cfg ( ) . target ( "x86_64-unknown-none" ) . build ( ) ;
955
+ assert ! ( check_ignore( & config, "//@ needs-target-std" ) ) ;
956
+ let config = cfg ( ) . target ( "x86_64-unknown-linux-gnu" ) . build ( ) ;
957
+ assert ! ( !check_ignore( & config, "//@ needs-target-std" ) ) ;
958
+ }
You can’t perform that action at this time.
0 commit comments