diff options
Diffstat (limited to 'tests/codegen-llvm/auxiliary/extern_decl.rs')
| -rw-r--r-- | tests/codegen-llvm/auxiliary/extern_decl.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/codegen-llvm/auxiliary/extern_decl.rs b/tests/codegen-llvm/auxiliary/extern_decl.rs new file mode 100644 index 00000000000..d17e77b1444 --- /dev/null +++ b/tests/codegen-llvm/auxiliary/extern_decl.rs @@ -0,0 +1,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; |
