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