Skip to content

Commit

Permalink
rewrite c-dynamic-rlib to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jul 17, 2024
1 parent a3d3b19 commit 77e80c1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
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 @@ -2,7 +2,6 @@ run-make/archive-duplicate-names/Makefile
run-make/atomic-lock-free/Makefile
run-make/branch-protection-check-IBT/Makefile
run-make/c-dynamic-dylib/Makefile
run-make/c-dynamic-rlib/Makefile
run-make/c-static-dylib/Makefile
run-make/c-static-rlib/Makefile
run-make/c-unwind-abi-catch-lib-panic/Makefile
Expand Down
19 changes: 0 additions & 19 deletions tests/run-make/c-dynamic-rlib/Makefile

This file was deleted.

22 changes: 22 additions & 0 deletions tests/run-make/c-dynamic-rlib/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// This test checks that dynamic Rust linking with C does not encounter any errors in both
// compilation and execution, with static dependencies given preference over dynamic.
// (This is the default behaviour.)
// See https://github.com/rust-lang/rust/issues/10434

//@ ignore-cross-compile
// Reason: the compiled binary is executed

//FIXME(Oneirical): test on apple because older versions of osx are failing apparently

use run_make_support::{
build_native_dynamic_lib, dynamic_lib_name, fs_wrapper, run, run_fail, rustc,
};

fn main() {
build_native_dynamic_lib("cfoo");
rustc().input("foo.rs").run();
rustc().input("bar.rs").run();
run("bar");
fs_wrapper::remove_file(dynamic_lib_name("cfoo"));
run_fail("bar");
}

0 comments on commit 77e80c1

Please sign in to comment.