rewrite used-cdylib-macos to rmake
This commit is contained in:
parent
ec1ed26263
commit
4c9eeda36d
@ -53,6 +53,7 @@
|
||||
"ignore-gnu",
|
||||
"ignore-haiku",
|
||||
"ignore-horizon",
|
||||
"ignore-i686-pc-windows-gnu",
|
||||
"ignore-i686-pc-windows-msvc",
|
||||
"ignore-illumos",
|
||||
"ignore-ios",
|
||||
@ -174,6 +175,7 @@
|
||||
"only-bpf",
|
||||
"only-cdb",
|
||||
"only-gnu",
|
||||
"only-i686-pc-windows-gnu",
|
||||
"only-i686-pc-windows-msvc",
|
||||
"only-ios",
|
||||
"only-linux",
|
||||
|
@ -186,7 +186,6 @@ run-make/track-pgo-dep-info/Makefile
|
||||
run-make/translation/Makefile
|
||||
run-make/type-mismatch-same-crate-name/Makefile
|
||||
run-make/unstable-flag-required/Makefile
|
||||
run-make/used-cdylib-macos/Makefile
|
||||
run-make/volatile-intrinsics/Makefile
|
||||
run-make/wasm-exceptions-nostd/Makefile
|
||||
run-make/wasm-override-linker/Makefile
|
||||
|
@ -4,7 +4,7 @@
|
||||
// way that previously failed due to this bug, and checks that it succeeds.
|
||||
// See https://github.com/rust-lang/rust/pull/108355
|
||||
|
||||
//@ ignore-i686-pc-windows-msvc
|
||||
//@ ignore-i686-pc-windows-gnu
|
||||
// Reason: dlltool on this distribution is unable to produce x64 binaries
|
||||
//@ needs-dlltool
|
||||
// Reason: this is the utility being checked by this test
|
||||
@ -29,12 +29,12 @@ fn main() {
|
||||
rustc()
|
||||
.crate_type("lib")
|
||||
.crate_name("x64_raw_dylib_test")
|
||||
.target("x86-64-pc-windows-gnu")
|
||||
.target("x86_64-pc-windows-gnu")
|
||||
.input("lib.rs")
|
||||
.run();
|
||||
llvm_objdump()
|
||||
.arg("-a")
|
||||
.input(rust_lib_name("i686_raw_dylib_test"))
|
||||
.input(rust_lib_name("x64_raw_dylib_test"))
|
||||
.run()
|
||||
.assert_stdout_not_contains("file format coff-i386")
|
||||
.assert_stdout_contains("file format coff-x86-64");
|
||||
|
@ -6,7 +6,8 @@
|
||||
// See https://github.com/rust-lang/rust/issues/68794
|
||||
|
||||
//@ ignore-cross-compile
|
||||
//FIXME(Oneirical): check that it works on more than just only-linux
|
||||
//@ ignore-windows
|
||||
// Reason: There is no `bar.dll` produced by CC to run readobj on
|
||||
|
||||
use run_make_support::{
|
||||
cc, dynamic_lib_name, extra_c_flags, extra_cxx_flags, llvm_readobj, rustc, static_lib_name,
|
||||
|
@ -1,11 +0,0 @@
|
||||
include ../tools.mk
|
||||
|
||||
# only-apple
|
||||
#
|
||||
# This checks that `#[used]` passes through to the linker on
|
||||
# Apple targets. This is subject to change in the future, see
|
||||
# https://github.com/rust-lang/rust/pull/93718 for discussion
|
||||
|
||||
all:
|
||||
$(RUSTC) -Copt-level=3 dylib_used.rs
|
||||
nm $(TMPDIR)/libdylib_used.dylib | $(CGREP) VERY_IMPORTANT_SYMBOL
|
16
tests/run-make/used-cdylib-macos/rmake.rs
Normal file
16
tests/run-make/used-cdylib-macos/rmake.rs
Normal file
@ -0,0 +1,16 @@
|
||||
// This checks that `#[used]` passes through to the linker on
|
||||
// Apple targets. This is subject to change in the future.
|
||||
// See https://github.com/rust-lang/rust/pull/93718
|
||||
|
||||
//@ only-apple
|
||||
|
||||
use run_make_support::{dynamic_lib_name, llvm_readobj, rustc};
|
||||
|
||||
fn main() {
|
||||
rustc().opt_level("3").input("dylib_used.rs").run();
|
||||
llvm_readobj()
|
||||
.input(dynamic_lib_name("dylib_used"))
|
||||
.arg("--all")
|
||||
.run()
|
||||
.assert_stdout_contains("VERY_IMPORTANT_SYMBOL");
|
||||
}
|
Loading…
Reference in New Issue
Block a user