File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,37 @@ fn basic() {
187187 assert_eq ! ( p. glob( deps_dir. join( "*.dylib" ) ) . count( ) , 0 ) ;
188188}
189189
190+ #[ cargo_test( build_std_real) ]
191+ fn lto ( ) {
192+ // Checks that `-Zbuild-std` can work with `lto = "thin"`.
193+ // This regression is from https://github.com/rust-lang/rust/issues/146109.
194+ let p = project ( )
195+ . file (
196+ "Cargo.toml" ,
197+ r#"
198+ [package]
199+ name = "foo"
200+ version = "0.1.0"
201+ edition = "2021"
202+
203+ [profile.dev]
204+ lto = "thin"
205+ "# ,
206+ )
207+ . file (
208+ "src/main.rs" ,
209+ r#"
210+ fn main() {}
211+ "# ,
212+ )
213+ . build ( ) ;
214+
215+ p. cargo ( "build" )
216+ . build_std_arg ( "std" )
217+ . env ( "RUSTFLAGS" , "-C linker-features=-lld" )
218+ . run ( ) ;
219+ }
220+
190221#[ cargo_test( build_std_real) ]
191222fn host_proc_macro ( ) {
192223 let p = project ( )
You can’t perform that action at this time.
0 commit comments