File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 11// build-pass
2- // compile-flags: --crate-type lib -Ccodegen-units=1
2+ // compile-flags: --crate-type=rlib --emit=llvm-ir -Cno-prepopulate-passes
33
44// This test declares globals by the same name with different types, which
55// caused problems because Module::getOrInsertGlobal would return a Constant*
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments