Rollup merge of #125104 - Oneirical:test6, r=jieyouxu · rust-lang/rust@2659ff3

File tree

3 files changed

lines changed

  • tests/run-make/no-cdylib-as-rdylib

3 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -178,7 +178,6 @@ run-make/native-link-modifier-whole-archive/Makefile

178178

run-make/no-alloc-shim/Makefile

179179

run-make/no-builtins-attribute/Makefile

180180

run-make/no-builtins-lto/Makefile

181-

run-make/no-cdylib-as-rdylib/Makefile

182181

run-make/no-duplicate-libs/Makefile

183182

run-make/no-intermediate-extras/Makefile

184183

run-make/obey-crate-type-flag/Makefile

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,16 @@

1+

// This test produces an rlib and a cdylib from bar.rs.

2+

// Then, foo.rs attempts to link to the bar library.

3+

// If the test passes, that means rustc favored the rlib and ignored the cdylib.

4+

// If the test fails, that is because the cdylib was picked, which does not export

5+

// any Rust symbols.

6+

// See https://github.com/rust-lang/rust/pull/113695

7+
8+

//@ ignore-cross-compile

9+
10+

use run_make_support::{run, rustc};

11+
12+

fn main() {

13+

rustc().input("bar.rs").crate_type("rlib").crate_type("cdylib").run();

14+

rustc().input("foo.rs").arg("-Cprefer-dynamic").run();

15+

run("foo");

16+

}