rust/tests/ui/linkage-attr/linkage-detect-local-generated-name-collision.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
524 B
Rust
Raw Normal View History

// build-fail
// FIXME(#83838) codegen-units=1 triggers llvm asserts
// compile-flags: -Ccodegen-units=16
#![feature(linkage)]
mod dep1 {
2020-09-01 16:12:52 -05:00
extern "C" {
#[linkage = "external"]
#[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);
}
}