]> git.lizzy.rs Git - rust.git/blob - tests/ui/statics/issue-91050-2.rs
Auto merge of #106825 - weihanglo:update-cargo, r=weihanglo
[rust.git] / tests / ui / statics / issue-91050-2.rs
1 // build-pass
2 // compile-flags: --crate-type=rlib --emit=llvm-ir -Cno-prepopulate-passes
3
4 // This is a variant of issue-91050-1.rs -- see there for an explanation.
5
6 pub mod before {
7     extern "C" {
8         pub static GLOBAL1: [u8; 1];
9     }
10
11     pub unsafe fn do_something_with_array() -> u8 {
12         GLOBAL1[0]
13     }
14 }
15
16 pub mod inner {
17     extern "C" {
18         pub static GLOBAL1: u8;
19     }
20
21     pub unsafe fn call() -> u8 {
22         GLOBAL1 + 42
23     }
24 }