File tree Expand file tree Collapse file tree 4 files changed +32
-2
lines changed
rust-lld-by-default-beta-stable
rust-lld-by-default-nightly Expand file tree Collapse file tree 4 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ // Ensure that rust-lld is *not* used as the default linker on `x86_64-unknown-linux-gnu` on stable
2+ // or beta.
3+
4+ //@ ignore-nightly
5+ //@ only-x86_64-unknown-linux-gnu
6+
7+ use run_make_support:: regex:: Regex ;
8+ use run_make_support:: rustc;
9+ use std:: process:: Output ;
10+
11+ fn main ( ) {
12+ // A regular compilation should not use rust-lld by default. We'll check that by asking the
13+ // linker to display its version number with a link-arg.
14+ let output = rustc ( )
15+ . env ( "RUSTC_LOG" , "rustc_codegen_ssa::back::link=info" )
16+ . link_arg ( "-Wl,-v" )
17+ . input ( "main.rs" )
18+ . run ( ) ;
19+ assert ! (
20+ !find_lld_version_in_logs( output. stderr_utf8( ) ) ,
21+ "the LLD version string should not be present in the output logs:\n {}" ,
22+ output. stderr_utf8( )
23+ ) ;
24+ }
25+
26+ fn find_lld_version_in_logs ( stderr : String ) -> bool {
27+ let lld_version_re = Regex :: new ( r"^LLD [0-9]+\.[0-9]+\.[0-9]+" ) . unwrap ( ) ;
28+ stderr. lines ( ) . any ( |line| lld_version_re. is_match ( line. trim ( ) ) )
29+ }
File renamed without changes.
Original file line number Diff line number Diff line change 1- // Ensure that rust-lld is used as the default linker on `x86_64-unknown-linux-gnu`, and that it can
2- // also be turned off with a CLI flag.
1+ // Ensure that rust-lld is used as the default linker on `x86_64-unknown-linux-gnu` on the nightly
2+ // channel, and that it can also be turned off with a CLI flag.
33
44//@ needs-rust-lld
55//@ ignore-beta
You can’t perform that action at this time.
0 commit comments