about summary refs log tree commit diff
path: root/tests/codegen-llvm/auxiliary/extern_decl.rs
blob: d17e77b144487204e44c69334f109cb9c9d71e2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Auxiliary crate that exports a function and static. Both always
// evaluate to `71`. We force mutability on the static to prevent
// it from being inlined as constant.

#![crate_type = "lib"]

#[no_mangle]
pub fn extern_fn() -> u8 {
    unsafe { extern_static }
}

#[no_mangle]
pub static mut extern_static: u8 = 71;