about summary refs log tree commit diff
path: root/tests/run-make/c-static-dylib/rmake.rs
blob: 12ec06c8199d69b1b13abb3bce24d80f1e9b2c93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// This test checks that static Rust linking with C does not encounter any errors,
// with dynamic dependencies given preference over static.
// See https://github.com/rust-lang/rust/issues/10434

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

use run_make_support::{
    build_native_static_lib, dynamic_lib_name, rfs, run, run_fail, rustc, static_lib_name,
};

fn main() {
    build_native_static_lib("cfoo");
    rustc().input("foo.rs").arg("-Cprefer-dynamic").run();
    rustc().input("bar.rs").run();
    rfs::remove_file(static_lib_name("cfoo"));
    run("bar");
    rfs::remove_file(dynamic_lib_name("foo"));
    run_fail("bar");
}