@@ -642,6 +642,7 @@ mod snapshot {
642642 } ;
643643 use crate :: core:: builder:: { Builder , Kind , StepDescription , StepMetadata } ;
644644 use crate :: core:: config:: TargetSelection ;
645+ use crate :: core:: config:: toml:: rust:: with_lld_opt_in_targets;
645646 use crate :: utils:: cache:: Cache ;
646647 use crate :: utils:: helpers:: get_host_target;
647648 use crate :: utils:: tests:: { ConfigBuilder , TestCtx } ;
@@ -1631,7 +1632,6 @@ mod snapshot {
16311632 #[ test]
16321633 fn doc_core_no_std_target ( ) {
16331634 let ctx = TestCtx :: new ( ) ;
1634-
16351635 insta:: assert_snapshot!(
16361636 ctx. config( "doc" )
16371637 . path( "core" )
@@ -1644,10 +1644,31 @@ mod snapshot {
16441644 " ) ;
16451645 }
16461646
1647+ #[ test]
1648+ fn test_lld_opt_in ( ) {
1649+ let target: & ' static str = Box :: leak ( Box :: new ( host_target ( ) ) ) ;
1650+ let slice: & ' static [ & ' static str ] = Box :: leak ( Box :: new ( [ target] ) ) ;
1651+
1652+ with_lld_opt_in_targets ( slice, || {
1653+ let ctx = TestCtx :: new ( ) ;
1654+
1655+ insta:: assert_snapshot!(
1656+ ctx. config( "doc" )
1657+ . path( "core" )
1658+ . override_target_no_std( & host_target( ) )
1659+ . render_steps( ) , @r"
1660+ [build] llvm <host>
1661+ [build] rustc 0 <host> -> rustc 1 <host>
1662+ [build] rustc 0 <host> -> LldWrapper 1 <host>
1663+ [build] rustdoc 0 <host>
1664+ [doc] std 1 <host> crates=[core]
1665+ " ) ;
1666+ } ) ;
1667+ }
1668+
16471669 #[ test]
16481670 fn doc_library_no_std_target ( ) {
16491671 let ctx = TestCtx :: new ( ) ;
1650-
16511672 insta:: assert_snapshot!(
16521673 ctx. config( "doc" )
16531674 . path( "library" )
0 commit comments