Skip to content

Commit

Permalink
port no-cdylib-as-rdylib test
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed May 14, 2024
1 parent d25cf6f commit 1f61cc3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 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 @@ -185,7 +185,6 @@ run-make/native-link-modifier-whole-archive/Makefile
run-make/no-alloc-shim/Makefile
run-make/no-builtins-attribute/Makefile
run-make/no-builtins-lto/Makefile
run-make/no-cdylib-as-rdylib/Makefile
run-make/no-duplicate-libs/Makefile
run-make/no-intermediate-extras/Makefile
run-make/obey-crate-type-flag/Makefile
Expand Down
16 changes: 0 additions & 16 deletions tests/run-make/no-cdylib-as-rdylib/Makefile

This file was deleted.

16 changes: 16 additions & 0 deletions tests/run-make/no-cdylib-as-rdylib/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This test produces an rlib and a cdylib from bar.rs.
// Then, foo.rs attempts to link to the bar library.
// If the test passes, that means rustc favored the rlib and ignored the cdylib.
// If the test fails, that is because the cdylib was picked, which does not export
// any Rust symbols.
// See https://github.com/rust-lang/rust/pull/113695

//@ ignore-cross-compile

use run_make_support::{run, rustc};

fn main() {
rustc().input("bar.rs").crate_type("rlib").crate_type("cdylib").run();
rustc().input("foo.rs").arg("-Cprefer-dynamic").run();
run("foo");
}

0 comments on commit 1f61cc3

Please sign in to comment.