Skip to content

Commit

Permalink
rewrite used-cdylib-macos to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jun 25, 2024
1 parent 42f0b81 commit 56ae84b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
2 changes: 2 additions & 0 deletions src/tools/compiletest/src/command-list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"ignore-gnu",
"ignore-haiku",
"ignore-horizon",
"ignore-i686-pc-windows-gnu",
"ignore-i686-pc-windows-msvc",
"ignore-illumos",
"ignore-ios",
Expand Down Expand Up @@ -174,6 +175,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"only-bpf",
"only-cdb",
"only-gnu",
"only-i686-pc-windows-gnu",
"only-i686-pc-windows-msvc",
"only-ios",
"only-linux",
Expand Down
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ run-make/translation/Makefile
run-make/type-mismatch-same-crate-name/Makefile
run-make/unstable-flag-required/Makefile
run-make/use-suggestions-rust-2018/Makefile
run-make/used-cdylib-macos/Makefile
run-make/volatile-intrinsics/Makefile
run-make/wasm-exceptions-nostd/Makefile
run-make/wasm-override-linker/Makefile
Expand Down
6 changes: 3 additions & 3 deletions tests/run-make/raw-dylib-cross-compilation/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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");
Expand Down
3 changes: 2 additions & 1 deletion tests/run-make/textrel-on-minimal-lib/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 0 additions & 11 deletions tests/run-make/used-cdylib-macos/Makefile

This file was deleted.

16 changes: 16 additions & 0 deletions tests/run-make/used-cdylib-macos/rmake.rs
Original file line number Diff line number Diff line change
@@ -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");
}

0 comments on commit 56ae84b

Please sign in to comment.