forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrmake.rs
More file actions
22 lines (18 loc) · 802 Bytes
/
rmake.rs
File metadata and controls
22 lines (18 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Regression test for https://github.com/rust-lang/rust/issues/148217
// BSD format archive on a Linux target should emit a format mismatch warning.
//@ ignore-cross-compile
//@ only-linux
use run_make_support::{cc, llvm_ar, path, rfs, rustc, static_lib_name};
fn main() {
rfs::create_dir("archive");
cc().arg("-c").input("native.c").output("archive/native.o").run();
let bsd_archive = path("archive").join(static_lib_name("native_bsd"));
llvm_ar().arg("rcus").arg("--format=bsd").output_input(&bsd_archive, "archive/native.o").run();
rustc()
.input("lib.rs")
.crate_type("rlib")
.library_search_path("archive")
.arg("-lstatic=native_bsd")
.run()
.assert_stderr_contains("was built as BSD format, but the target expects GNU");
}