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