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