blob: cdd63494e61a25a077854ac7d6960f6cd3da489a [file] [log] [blame]
Chris Lattnera99fb662002-10-09 20:37:13 +00001; Test that: extern int X[] and int X[] = { 1, 2, 3, 4 } are resolved
2; correctly. This doesn't have constantexprs
3;
Misha Brukmane78760e2003-09-16 15:29:54 +00004; RUN: llvm-as < %s | opt -funcresolve | llvm-dis | not grep external
Chris Lattnera99fb662002-10-09 20:37:13 +00005;
6
Chris Lattner2ff93432003-04-19 00:17:11 +00007%X = external global [0 x int]
Chris Lattnera99fb662002-10-09 20:37:13 +00008%X = global [4 x int] [ int 1, int 2, int 3, int 4 ]
9
10implementation ; Functions:
11
12int %foo(int %x) {
13bb1: ;[#uses=0]
Chris Lattner2ff93432003-04-19 00:17:11 +000014 %G = getelementptr [0 x int]* %X, long 0, long 1
Chris Lattnera99fb662002-10-09 20:37:13 +000015 store int 5, int* %G
Chris Lattner2ff93432003-04-19 00:17:11 +000016 %F = getelementptr [0 x int]* %X, long 0, long 2
Chris Lattnera99fb662002-10-09 20:37:13 +000017 %val = load int* %F
18 ret int %val
19}
20