2019-12-13 21:28:32 -06:00
|
|
|
// build-fail
|
2021-03-26 13:01:55 -05:00
|
|
|
// FIXME(#83838) codegen-units=1 triggers llvm asserts
|
|
|
|
// compile-flags: -Ccodegen-units=16
|
2019-05-27 05:08:10 -05:00
|
|
|
#![feature(linkage)]
|
|
|
|
|
|
|
|
mod dep1 {
|
2020-09-01 16:12:52 -05:00
|
|
|
extern "C" {
|
|
|
|
#[linkage = "external"]
|
2019-05-27 05:08:10 -05:00
|
|
|
#[no_mangle]
|
|
|
|
pub static collision: *const i32; //~ ERROR symbol `collision` is already defined
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[no_mangle]
|
|
|
|
pub static _rust_extern_with_linkage_collision: i32 = 0;
|
|
|
|
|
|
|
|
mod dep2 {
|
|
|
|
#[no_mangle]
|
|
|
|
pub static collision: usize = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
unsafe {
|
2020-09-01 16:12:52 -05:00
|
|
|
println!("{:p}", &dep1::collision);
|
2019-05-27 05:08:10 -05:00
|
|
|
}
|
|
|
|
}
|