rewrite used-cdylib-macos to rmake

This commit is contained in:
Oneirical 2024-06-19 11:38:22 -04:00
parent ec1ed26263
commit 4c9eeda36d
6 changed files with 23 additions and 16 deletions

View File

@ -53,6 +53,7 @@
"ignore-gnu", "ignore-gnu",
"ignore-haiku", "ignore-haiku",
"ignore-horizon", "ignore-horizon",
"ignore-i686-pc-windows-gnu",
"ignore-i686-pc-windows-msvc", "ignore-i686-pc-windows-msvc",
"ignore-illumos", "ignore-illumos",
"ignore-ios", "ignore-ios",
@ -174,6 +175,7 @@
"only-bpf", "only-bpf",
"only-cdb", "only-cdb",
"only-gnu", "only-gnu",
"only-i686-pc-windows-gnu",
"only-i686-pc-windows-msvc", "only-i686-pc-windows-msvc",
"only-ios", "only-ios",
"only-linux", "only-linux",

View File

@ -186,7 +186,6 @@ run-make/track-pgo-dep-info/Makefile
run-make/translation/Makefile run-make/translation/Makefile
run-make/type-mismatch-same-crate-name/Makefile run-make/type-mismatch-same-crate-name/Makefile
run-make/unstable-flag-required/Makefile run-make/unstable-flag-required/Makefile
run-make/used-cdylib-macos/Makefile
run-make/volatile-intrinsics/Makefile run-make/volatile-intrinsics/Makefile
run-make/wasm-exceptions-nostd/Makefile run-make/wasm-exceptions-nostd/Makefile
run-make/wasm-override-linker/Makefile run-make/wasm-override-linker/Makefile

View File

@ -4,7 +4,7 @@
// way that previously failed due to this bug, and checks that it succeeds. // way that previously failed due to this bug, and checks that it succeeds.
// See https://github.com/rust-lang/rust/pull/108355 // 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 // Reason: dlltool on this distribution is unable to produce x64 binaries
//@ needs-dlltool //@ needs-dlltool
// Reason: this is the utility being checked by this test // Reason: this is the utility being checked by this test
@ -29,12 +29,12 @@ fn main() {
rustc() rustc()
.crate_type("lib") .crate_type("lib")
.crate_name("x64_raw_dylib_test") .crate_name("x64_raw_dylib_test")
.target("x86-64-pc-windows-gnu") .target("x86_64-pc-windows-gnu")
.input("lib.rs") .input("lib.rs")
.run(); .run();
llvm_objdump() llvm_objdump()
.arg("-a") .arg("-a")
.input(rust_lib_name("i686_raw_dylib_test")) .input(rust_lib_name("x64_raw_dylib_test"))
.run() .run()
.assert_stdout_not_contains("file format coff-i386") .assert_stdout_not_contains("file format coff-i386")
.assert_stdout_contains("file format coff-x86-64"); .assert_stdout_contains("file format coff-x86-64");

View File

@ -6,7 +6,8 @@
// See https://github.com/rust-lang/rust/issues/68794 // See https://github.com/rust-lang/rust/issues/68794
//@ ignore-cross-compile //@ 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::{ use run_make_support::{
cc, dynamic_lib_name, extra_c_flags, extra_cxx_flags, llvm_readobj, rustc, static_lib_name, cc, dynamic_lib_name, extra_c_flags, extra_cxx_flags, llvm_readobj, rustc, static_lib_name,

View File

@ -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

View 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");
}