File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 1+ //! Check that `cfg!(target_feature = "...")` correctly detects available CPU features,
2+ //! specifically `sse2` on x86/x86_64 platforms, and correctly reports absent features.
3+
14//@ run-pass
25
36#![ allow( stable_features) ]
@@ -10,17 +13,23 @@ fn main() {
1013 Ok ( s) => {
1114 // Skip this tests on i586-unknown-linux-gnu where sse2 is disabled
1215 if s. contains ( "i586" ) {
13- return
16+ return ;
1417 }
1518 }
1619 Err ( _) => return ,
1720 }
1821 if cfg ! ( any( target_arch = "x86" , target_arch = "x86_64" ) ) {
19- assert ! ( cfg!( target_feature = "sse2" ) ,
20- "SSE2 was not detected as available on an x86 platform" ) ;
22+ assert ! (
23+ cfg!( target_feature = "sse2" ) ,
24+ "SSE2 was not detected as available on an x86 platform"
25+ ) ;
2126 }
2227 // check a negative case too -- certainly not enabled by default
2328 #[ expect( unexpected_cfgs) ]
24- { assert ! ( cfg!( not( target_feature = "ferris_wheel" ) ) ,
25- "🎡 shouldn't be detected as available by default on any platform" ) } ;
29+ {
30+ assert ! (
31+ cfg!( not( target_feature = "ferris_wheel" ) ) ,
32+ "🎡 shouldn't be detected as available by default on any platform"
33+ )
34+ } ;
2635}
You can’t perform that action at this time.
0 commit comments