1515//@ ignore-cross-compile
1616
1717use run_make_support:: { llvm_profdata, rustc, rustdoc, stdin_command, target, tmp_dir} ;
18- use std:: io:: { self , Write } ;
19- use std:: process:: Command ;
2018
2119fn main ( ) {
2220 // For some very small programs GNU ld seems to not properly handle
2321 // instrumentation sections correctly. Neither Gold nor LLD have that
2422 // problem.
25- let link_args = ( cfg ! ( target_os = "linux" ) && target ( ) . contains ( "x86" ) ) . then_some ( "-Clink-args=-fuse-ld=gold" ) ;
23+ let link_args = ( cfg ! ( target_os = "linux" ) && target ( ) . contains ( "x86" ) )
24+ . then_some ( "-Clink-args=-fuse-ld=gold" ) ;
2625
2726 let path_prof_data_dir = tmp_dir ( ) . join ( "prof_data_dir" ) ;
2827 let path_merged_profdata = path_prof_data_dir. join ( "merged.profdata" ) ;
@@ -32,24 +31,28 @@ fn main() {
3231 }
3332 invoc. run ( ) ;
3433 fs:: create_dir_all ( & path_prof_data_dir) ;
35- let invoc = rustc ( ) . input ( "interesting.rs" )
34+ let invoc = rustc ( )
35+ . input ( "interesting.rs" )
3636 . profile_generate ( & path_prof_data_dir)
3737 . opt ( )
3838 . codegen_units ( 1 ) ;
3939 if let Some ( link_args) = link_args {
4040 invoc. arg ( link_args) ;
4141 }
4242 invoc. run ( ) ;
43- let invoc = rustc ( ) . input ( "main.rs" )
44- . profile_generate ( & path_prof_data_dir)
45- . opt ( ) ;
43+ let invoc = rustc ( ) . input ( "main.rs" ) . profile_generate ( & path_prof_data_dir) . opt ( ) ;
4644 if let Some ( link_args) = link_args {
4745 invoc. arg ( link_args) ;
4846 }
4947 invoc. run ( ) ;
5048 run ( "main" ) ;
51- llvm_profdata ( ) . merge ( ) . output ( & path_merged_profdata) . input ( path_prof_data_dir) . command_output ( ) ;
52- let invoc = rustc ( ) . input ( "interesting.rs" )
49+ llvm_profdata ( )
50+ . merge ( )
51+ . output ( & path_merged_profdata)
52+ . input ( path_prof_data_dir)
53+ . command_output ( ) ;
54+ let invoc = rustc ( )
55+ . input ( "interesting.rs" )
5356 . profile_use ( path_merged_profdata)
5457 . opt ( )
5558 . codegen_units ( 1 )
0 commit comments