1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 |grep "foos+5" &&
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 |grep "foos+1" &&
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 |grep "foos+9" &&
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 |grep "bara+19" &&
5 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 |grep "bara+4"
7 ; make sure we compute the correct offset for a packed structure
9 ;Note: codegen for this could change rendering the above checks wrong
12 target datalayout = "e-p:32:32"
13 target endian = little
14 target pointersize = 32
15 target triple = "i686-pc-linux-gnu"
16 %struct.anon = type <{ sbyte, int, int, int }>
17 %foos = external global %struct.anon
18 %bara = weak global [4 x <{ int, sbyte }>] zeroinitializer
20 implementation ; Functions:
24 %tmp = load int* getelementptr (%struct.anon* %foos, int 0, uint 1)
25 %tmp3 = load int* getelementptr (%struct.anon* %foos, int 0, uint 2)
26 %tmp6 = load int* getelementptr (%struct.anon* %foos, int 0, uint 3)
27 %tmp4 = add int %tmp3, %tmp
28 %tmp7 = add int %tmp4, %tmp6
34 %tmp = load sbyte* getelementptr([4 x <{ int, sbyte }>]* %bara, int 0, int 0, uint 1 )
35 %tmp4 = load sbyte* getelementptr ([4 x <{ int, sbyte }>]* %bara, int 0, int 3, uint 1)
36 %tmp5 = add sbyte %tmp4, %tmp