@@ -3537,6 +3537,71 @@ impl Step for CodegenGCC {
3537
3537
}
3538
3538
}
3539
3539
3540
+ /// Smoke test for stdarch which simply checks if we can build it with the in-tree
3541
+ /// compiler.
3542
+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
3543
+ pub struct Stdarch {
3544
+ compiler : Compiler ,
3545
+ target : TargetSelection ,
3546
+ }
3547
+
3548
+ impl Step for Stdarch {
3549
+ type Output = ( ) ;
3550
+ const DEFAULT : bool = true ;
3551
+ const ONLY_HOSTS : bool = true ;
3552
+
3553
+ fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
3554
+ run. paths ( & [ "library/stdarch" ] )
3555
+ }
3556
+
3557
+ fn make_run ( run : RunConfig < ' _ > ) {
3558
+ let builder = run. builder ;
3559
+ let host = run. build_triple ( ) ;
3560
+ let compiler = run. builder . compiler_for ( run. builder . top_stage , host, host) ;
3561
+
3562
+ builder. ensure ( Stdarch { compiler, target : run. target } ) ;
3563
+ }
3564
+
3565
+ fn run ( self , builder : & Builder < ' _ > ) {
3566
+ let compiler = self . compiler ;
3567
+ let target = self . target ;
3568
+
3569
+ builder. ensure ( compile:: Std :: new ( compiler, target) ) ;
3570
+
3571
+ let mut cargo = builder:: Cargo :: new (
3572
+ builder,
3573
+ compiler,
3574
+ Mode :: ToolRustc ,
3575
+ SourceType :: InTree ,
3576
+ target,
3577
+ Kind :: Check ,
3578
+ ) ;
3579
+
3580
+ cargo. current_dir ( & builder. src . join ( "library/stdarch" ) ) ;
3581
+ cargo. arg ( "--manifest-path" ) . arg ( builder. src . join ( "library/stdarch/Cargo.toml" ) ) ;
3582
+
3583
+ // Just check that we can compile core_arch and std_detect for the given target
3584
+ cargo
3585
+ . arg ( "-p" )
3586
+ . arg ( "core_arch" )
3587
+ . arg ( "-p" )
3588
+ . arg ( "std_detect" )
3589
+ . arg ( "--all-targets" )
3590
+ . env ( "TARGET" , target. triple ) ;
3591
+
3592
+ builder. info ( & format ! (
3593
+ "{} stdarch stage{} ({} -> {})" ,
3594
+ Kind :: Test . description( ) ,
3595
+ compiler. stage,
3596
+ & compiler. host,
3597
+ target
3598
+ ) ) ;
3599
+ let _time = helpers:: timeit ( builder) ;
3600
+
3601
+ cargo. into_cmd ( ) . run ( builder) ;
3602
+ }
3603
+ }
3604
+
3540
3605
/// Test step that does two things:
3541
3606
/// - Runs `cargo test` for the `src/tools/test-float-parse` tool.
3542
3607
/// - Invokes the `test-float-parse` tool to test the standard library's
0 commit comments