mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-28 13:46:03 +00:00

In particular, anything that includes `none` in the target tripple, and `nvptx64-nvidia-cuda`
24 lines
846 B
Rust
24 lines
846 B
Rust
//@ needs-target-std
|
|
//
|
|
// In 2016, the rustc flag "-C link-arg" was introduced - it can be repeatedly used
|
|
// to add single arguments to the linker. This test passes 2 arguments to the linker using it,
|
|
// then checks that the compiler's output contains the arguments passed to it.
|
|
// This ensures that the compiler successfully parses this flag.
|
|
// See https://github.com/rust-lang/rust/pull/36574
|
|
|
|
use run_make_support::rustc;
|
|
|
|
fn main() {
|
|
// We are only checking for the output of --print=link-args,
|
|
// rustc failing or succeeding does not matter.
|
|
let out = rustc()
|
|
.input("empty.rs")
|
|
.link_arg("-lfoo")
|
|
.link_arg("-lbar")
|
|
.print("link-args")
|
|
.run_unchecked();
|
|
out.assert_stdout_contains("lfoo");
|
|
out.assert_stdout_contains("lbar");
|
|
assert!(out.stdout_utf8().ends_with('\n'));
|
|
}
|