about summary refs log tree commit diff
path: root/tests/run-make/extern-diff-internal-name/rmake.rs
blob: c905de1d9a8dc63e8a85f74901b062c07568f892 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ ignore-cross-compile

// In the following scenario:
// 1. The crate foo, is referenced multiple times
// 2. --extern foo=./path/to/libbar.rlib is specified to rustc
// 3. The internal crate name of libbar.rlib is not foo
// Compilation fails with the "multiple crate versions" error message.
// As this was fixed in #17189, this regression test ensures this bug does not
// make a resurgence.
// See https://github.com/rust-lang/rust/pull/17189

use run_make_support::{rust_lib_name, rustc};

fn main() {
    rustc().input("lib.rs").run();
    rustc().input("test.rs").extern_("foo", rust_lib_name("bar")).run();
}