@@ -642,6 +642,7 @@ mod snapshot {
642
642
} ;
643
643
use crate :: core:: builder:: { Builder , Kind , StepDescription , StepMetadata } ;
644
644
use crate :: core:: config:: TargetSelection ;
645
+ use crate :: core:: config:: toml:: rust:: with_lld_opt_in_targets;
645
646
use crate :: utils:: cache:: Cache ;
646
647
use crate :: utils:: helpers:: get_host_target;
647
648
use crate :: utils:: tests:: { ConfigBuilder , TestCtx } ;
@@ -1631,7 +1632,6 @@ mod snapshot {
1631
1632
#[ test]
1632
1633
fn doc_core_no_std_target ( ) {
1633
1634
let ctx = TestCtx :: new ( ) ;
1634
-
1635
1635
insta:: assert_snapshot!(
1636
1636
ctx. config( "doc" )
1637
1637
. path( "core" )
@@ -1644,10 +1644,31 @@ mod snapshot {
1644
1644
" ) ;
1645
1645
}
1646
1646
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
+
1647
1669
#[ test]
1648
1670
fn doc_library_no_std_target ( ) {
1649
1671
let ctx = TestCtx :: new ( ) ;
1650
-
1651
1672
insta:: assert_snapshot!(
1652
1673
ctx. config( "doc" )
1653
1674
. path( "library" )
0 commit comments