@@ -3605,6 +3605,65 @@ impl Step for CodegenGCC {
3605
3605
}
3606
3606
}
3607
3607
3608
+ /// Smoke test for stdarch which simply checks if we can build it with the in-tree
3609
+ /// compiler.
3610
+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
3611
+ pub struct Stdarch {
3612
+ compiler : Compiler ,
3613
+ target : TargetSelection ,
3614
+ }
3615
+
3616
+ impl Step for Stdarch {
3617
+ type Output = ( ) ;
3618
+ const DEFAULT : bool = true ;
3619
+ const ONLY_HOSTS : bool = true ;
3620
+
3621
+ fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
3622
+ run. paths ( & [ "library/stdarch" ] )
3623
+ }
3624
+
3625
+ fn make_run ( run : RunConfig < ' _ > ) {
3626
+ let builder = run. builder ;
3627
+ let host = run. build_triple ( ) ;
3628
+ let compiler = run. builder . compiler ( run. builder . top_stage , host) ;
3629
+
3630
+ builder. ensure ( Stdarch { compiler, target : run. target } ) ;
3631
+ }
3632
+
3633
+ fn run ( self , builder : & Builder < ' _ > ) {
3634
+ let compiler = self . compiler ;
3635
+ let target = self . target ;
3636
+
3637
+ builder. ensure ( compile:: Std :: new ( compiler, target) ) ;
3638
+
3639
+ let mut cargo = builder:: Cargo :: new (
3640
+ builder,
3641
+ compiler,
3642
+ Mode :: ToolRustc ,
3643
+ SourceType :: InTree ,
3644
+ target,
3645
+ Kind :: Check ,
3646
+ ) ;
3647
+
3648
+ cargo. current_dir ( & builder. src . join ( "library/stdarch" ) ) ;
3649
+ cargo. arg ( "--manifest-path" ) . arg ( builder. src . join ( "library/stdarch/Cargo.toml" ) ) ;
3650
+
3651
+ // Just check that we can compile core_arch and std_detect for the given target
3652
+ cargo. arg ( "-p" ) . arg ( "core_arch" ) . arg ( "--all-targets" ) . env ( "TARGET" , target. triple ) ;
3653
+
3654
+ builder. info ( & format ! (
3655
+ "{} stdarch stage{} ({} -> {})" ,
3656
+ Kind :: Test . description( ) ,
3657
+ compiler. stage,
3658
+ & compiler. host,
3659
+ target
3660
+ ) ) ;
3661
+ let _time = helpers:: timeit ( builder) ;
3662
+
3663
+ cargo. into_cmd ( ) . run ( builder) ;
3664
+ }
3665
+ }
3666
+
3608
3667
/// Test step that does two things:
3609
3668
/// - Runs `cargo test` for the `src/tools/test-float-parse` tool.
3610
3669
/// - Invokes the `test-float-parse` tool to test the standard library's
0 commit comments