1 ; Test that: extern int X[] and int X[] = { 1, 2, 3, 4 } are resolved correctly.
3 ; RUN: if as < %s | opt -gcse -instcombine -constprop -dce | dis | grep getelementptr
9 %X = uninitialized global int ; <int*> [#uses=1]
10 %X = global [4 x int] [ int 1, int 2, int 3, int 4 ] ; <[4 x int]*> [#uses=1]
12 implementation ; Functions:
16 %reg107-idxcast = cast int %x to uint ; <uint> [#uses=2]
17 %reg113 = getelementptr int* %X, uint %reg107-idxcast ; <int*> [#uses=1]
18 %reg120 = getelementptr [4 x int]* %X, uint 0, uint %reg107-idxcast ; <int*> [#uses=1]
19 %reg123 = sub int* %reg113, %reg120 ; <int*> [#uses=1]
20 %cast232 = cast int* %reg123 to long ; <long> [#uses=1]
21 %reg234 = div long %cast232, 4 ; <long> [#uses=1]
22 %cast108 = cast long %reg234 to int ; <int> [#uses=1]