@@ -3537,6 +3537,65 @@ impl Step for CodegenGCC {
35373537 }
35383538}
35393539
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. arg ( "-p" ) . arg ( "core_arch" ) . arg ( "--all-targets" ) . env ( "TARGET" , target. triple ) ;
3585+
3586+ builder. info ( & format ! (
3587+ "{} stdarch stage{} ({} -> {})" ,
3588+ Kind :: Test . description( ) ,
3589+ compiler. stage,
3590+ & compiler. host,
3591+ target
3592+ ) ) ;
3593+ let _time = helpers:: timeit ( builder) ;
3594+
3595+ cargo. into_cmd ( ) . run ( builder) ;
3596+ }
3597+ }
3598+
35403599/// Test step that does two things:
35413600/// - Runs `cargo test` for the `src/tools/test-float-parse` tool.
35423601/// - Invokes the `test-float-parse` tool to test the standard library's
0 commit comments