File tree Expand file tree Collapse file tree 3 files changed +27
-6
lines changed
tests/run-make/pass-linker-flags Expand file tree Collapse file tree 3 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,6 @@ run-make/output-type-permutations/Makefile
108108run-make/panic-abort-eh_frame/Makefile
109109run-make/pass-linker-flags-flavor/Makefile
110110run-make/pass-linker-flags-from-dep/Makefile
111- run-make/pass-linker-flags/Makefile
112111run-make/pass-non-c-like-enum-to-c/Makefile
113112run-make/pdb-buildinfo-cl-cmd/Makefile
114113run-make/pgo-gen-lto/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ // This test checks the proper function of `-l link-arg=NAME`, which, unlike
2+ // -C link-arg, is supposed to guarantee that the order relative to other -l
3+ // options will be respected. In this test, compilation fails (because none of the
4+ // link arguments like `a1` exist), but it is still checked if the output contains the
5+ // link arguments in the exact order they were passed in. `attribute.rs` is a variant
6+ // of the test where the flags are defined in the rust file itself.
7+ // See https://github.com/rust-lang/rust/issues/99427
8+
9+ use run_make_support:: { regex, rustc} ;
10+
11+ fn main ( ) {
12+ let out = rustc ( )
13+ . input ( "empty.rs" )
14+ . arg ( "-Zunstable-options" )
15+ . args ( & [ "-l" , "static=l1" ] )
16+ . arg ( "-llink-arg=a1" )
17+ . arg ( "-lstatic=l2" )
18+ . arg ( "-llink-arg=a2" )
19+ . arg ( "-ldylib=d1" )
20+ . arg ( "-llink-arg=a3" )
21+ . print ( "link-args" )
22+ . run_unchecked ( )
23+ . stdout_utf8 ( ) ;
24+ let out2 = rustc ( ) . input ( "attribute.rs" ) . print ( "link-args" ) . run_unchecked ( ) . stdout_utf8 ( ) ;
25+ let re = regex:: Regex :: new ( "l1.*a1.*l2.*a2.*d1.*a3" ) . unwrap ( ) ;
26+ assert ! ( re. is_match( & out) && re. is_match( & out2) ) ;
27+ }
You can’t perform that action at this time.
0 commit comments