Skip to content

Commit 3b2cfa5

Browse files
cuvipernagisa
andcommitted
Add another test variant of issue-91050
Co-authored-by: Simonas Kazlauskas <[email protected]>
1 parent 023cc96 commit 3b2cfa5

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/test/ui/issues/issue-91050.rs renamed to src/test/ui/issues/issue-91050-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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*

src/test/ui/issues/issue-91050-2.rs

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
}

0 commit comments

Comments
 (0)