Skip to content

Commit b889321

Browse files
committed
rewrite rlib-format-packed-bundled-libs-2 to rmake
1 parent d111ccd commit b889321

File tree

3 files changed

+32
-28
lines changed

3 files changed

+32
-28
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ run-make/redundant-libs/Makefile
6868
run-make/remap-path-prefix-dwarf/Makefile
6969
run-make/reproducible-build-2/Makefile
7070
run-make/reproducible-build/Makefile
71-
run-make/rlib-format-packed-bundled-libs-2/Makefile
7271
run-make/rlib-format-packed-bundled-libs/Makefile
7372
run-make/sanitizer-cdylib-link/Makefile
7473
run-make/sanitizer-dylib-link/Makefile

tests/run-make/rlib-format-packed-bundled-libs-2/Makefile

-27
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// `-Z packed_bundled_libs` is an unstable rustc flag that makes the compiler
2+
// only require a native library and no supplementary object files to compile.
3+
// This test simply checks that this flag can be passed alongside verbatim syntax
4+
// in rustc flags without a compilation failure or the removal of expected symbols.
5+
// See https://github.com/rust-lang/rust/pull/100101
6+
7+
//FIXME(Oneirical): try it on test-various
8+
9+
use run_make_support::{llvm_ar, llvm_readobj, regex, rfs, rust_lib_name, rustc};
10+
11+
fn main() {
12+
// Build a strangely named dependency.
13+
rustc().input("native_dep.rs").crate_type("staticlib").output("native_dep.ext").run();
14+
15+
rustc().input("rust_dep.rs").crate_type("rlib").arg("-Zpacked_bundled_libs").run();
16+
let symbols = llvm_readobj().symbols().input(rust_lib_name("rust_dep")).run().stdout_utf8();
17+
let re = regex::Regex::new("U.*native_f1").unwrap();
18+
assert!(re.is_match(&symbols));
19+
llvm_ar()
20+
.arg("t")
21+
.arg(rust_lib_name("rust_dep"))
22+
.run()
23+
.assert_stdout_contains("native_dep.ext");
24+
25+
// Ensure the compiler does not use files it should not be aware of.
26+
rfs::remove_file("native_dep.ext");
27+
rustc()
28+
.input("main.rs")
29+
.extern_("rust_dep", rust_lib_name("rust_dep"))
30+
.arg("-Zpacked_bundled_libs")
31+
.run();
32+
}

0 commit comments

Comments
 (0)