Skip to content

Commit f11ab15

Browse files
committed
rewrite pass-linker-flags to rmake
1 parent e2cf31a commit f11ab15

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ run-make/output-type-permutations/Makefile
108108
run-make/panic-abort-eh_frame/Makefile
109109
run-make/pass-linker-flags-flavor/Makefile
110110
run-make/pass-linker-flags-from-dep/Makefile
111-
run-make/pass-linker-flags/Makefile
112111
run-make/pass-non-c-like-enum-to-c/Makefile
113112
run-make/pdb-buildinfo-cl-cmd/Makefile
114113
run-make/pgo-gen-lto/Makefile

tests/run-make/pass-linker-flags/Makefile

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
}

0 commit comments

Comments
 (0)