llvm.org GIT mirror llvm / 30e2d91
Update testcases to be more modern git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8420 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 16 years ago
4 changed file(s) with 26 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
1717 %ArrayA = alloca %MixedA, uint 4
1818 %ArrayB = alloca %MixedB, uint 3
1919
20 %I1 = getelementptr %MixedA* %ScalarA, uint 0, ubyte 0
20 %I1 = getelementptr %MixedA* %ScalarA, long 0, ubyte 0
2121 store float 1.4142, float *%I1
22 %I2 = getelementptr %MixedB* %ScalarB, uint 0, ubyte 1, ubyte 0
22 %I2 = getelementptr %MixedB* %ScalarB, long 0, ubyte 1, ubyte 0
2323 store float 2.7183, float *%I2
2424
25 %fptrA = getelementptr %MixedA* %ArrayA, uint 1, ubyte 0
26 %fptrB = getelementptr %MixedB* %ArrayB, uint 2, ubyte 1, ubyte 0
25 %fptrA = getelementptr %MixedA* %ArrayA, long 1, ubyte 0
26 %fptrB = getelementptr %MixedB* %ArrayB, long 2, ubyte 1, ubyte 0
2727
2828 store float 3.1415, float* %fptrA
2929 store float 5.0, float* %fptrB
3030
3131 ;; Test that a sequence of GEPs with constant indices are folded right
32 %fptrA1 = getelementptr %MixedA* %ArrayA, uint 3 ; &ArrayA[3]
33 %fptrA2 = getelementptr %MixedA* %fptrA1, uint 0, ubyte 1 ; &(*fptrA1).1
34 %fptrA3 = getelementptr [15 x int]* %fptrA2, uint 0, uint 8 ; &(*fptrA2)[8]
32 %fptrA1 = getelementptr %MixedA* %ArrayA, long 3 ; &ArrayA[3]
33 %fptrA2 = getelementptr %MixedA* %fptrA1, long 0, ubyte 1 ; &(*fptrA1).1
34 %fptrA3 = getelementptr [15 x int]* %fptrA2, long 0, long 8 ; &(*fptrA2)[8]
3535 store int 5, int* %fptrA3 ; ArrayA[3].1[8] = 5
3636
3737 %sqrtTwo = load float *%I1
3838 %exp = load float *%I2
39 %I3 = getelementptr %MixedA* %ArrayA, uint 1, ubyte 0
39 %I3 = getelementptr %MixedA* %ArrayA, long 1, ubyte 0
4040 %pi = load float* %I3
41 %I4 = getelementptr %MixedB* %ArrayB, uint 2, ubyte 1, ubyte 0
41 %I4 = getelementptr %MixedB* %ArrayB, long 2, ubyte 1, ubyte 0
4242 %five = load float* %I4
4343
4444 %dsqrtTwo = cast float %sqrtTwo to double
4646 %dpi = cast float %pi to double
4747 %dfive = cast float %five to double
4848
49 %castFmt = getelementptr [44 x sbyte]* %fmtArg, uint 0, uint 0
49 %castFmt = getelementptr [44 x sbyte]* %fmtArg, long 0, long 0
5050 call int (sbyte*, ...)* %printf(sbyte* %castFmt, double %dsqrtTwo, double %dexp, double %dpi, double %dfive)
5151
5252 ret int 0
4040 %i = add uint 1, 0 ; i = 1
4141 %iscale = mul uint %i, 4294967295 ; i*-1 = -1
4242 %ioff = add uint %iscale, 3 ; 3+(-i) = 2
43 %fptr = getelementptr %Results* %fval, uint %ioff ; &fval[2]
44 %castFmt = getelementptr [39 x sbyte]* %fmtArg, uint 0, uint 0
43 %ioff = cast uint %ioff to long
44 %fptr = getelementptr %Results* %fval, long %ioff ; &fval[2]
45 %castFmt = getelementptr [39 x sbyte]* %fmtArg, long 0, long 0
4546 call int (sbyte*, ...)* %printf(sbyte* %castFmt, uint %ioff, %Results* %fval, %Results* %fptr)
4647 ret int 0
4748 end
1717 %ArrayA = alloca %MixedA, uint 4
1818 %ArrayB = alloca %MixedB, uint 3
1919
20 %I1 = getelementptr %MixedA* %ScalarA, uint 0, ubyte 0
20 %I1 = getelementptr %MixedA* %ScalarA, long 0, ubyte 0
2121 store float 1.4142, float *%I1
22 %I2 = getelementptr %MixedB* %ScalarB, uint 0, ubyte 1, ubyte 0
22 %I2 = getelementptr %MixedB* %ScalarB, long 0, ubyte 1, ubyte 0
2323 store float 2.7183, float *%I2
2424
25 %fptrA = getelementptr %MixedA* %ArrayA, uint 1, ubyte 0
26 %fptrB = getelementptr %MixedB* %ArrayB, uint 2, ubyte 1, ubyte 0
25 %fptrA = getelementptr %MixedA* %ArrayA, long 1, ubyte 0
26 %fptrB = getelementptr %MixedB* %ArrayB, long 2, ubyte 1, ubyte 0
2727
2828 store float 3.1415, float* %fptrA
2929 store float 5.0, float* %fptrB
3030
3131 ;; Test that a sequence of GEPs with constant indices are folded right
32 %fptrA1 = getelementptr %MixedA* %ArrayA, uint 3 ; &ArrayA[3]
33 %fptrA2 = getelementptr %MixedA* %fptrA1, uint 0, ubyte 1 ; &(*fptrA1).1
34 %fptrA3 = getelementptr [15 x int]* %fptrA2, uint 0, uint 8 ; &(*fptrA2)[8]
32 %fptrA1 = getelementptr %MixedA* %ArrayA, long 3 ; &ArrayA[3]
33 %fptrA2 = getelementptr %MixedA* %fptrA1, long 0, ubyte 1 ; &(*fptrA1).1
34 %fptrA3 = getelementptr [15 x int]* %fptrA2, long 0, long 8 ; &(*fptrA2)[8]
3535 store int 5, int* %fptrA3 ; ArrayA[3].1[8] = 5
3636
3737 %sqrtTwo = load float *%I1
3838 %exp = load float *%I2
39 %I3 = getelementptr %MixedA* %ArrayA, uint 1, ubyte 0
39 %I3 = getelementptr %MixedA* %ArrayA, long 1, ubyte 0
4040 %pi = load float* %I3
41 %I4 = getelementptr %MixedB* %ArrayB, uint 2, ubyte 1, ubyte 0
41 %I4 = getelementptr %MixedB* %ArrayB, long 2, ubyte 1, ubyte 0
4242 %five = load float* %I4
4343
4444 %dsqrtTwo = cast float %sqrtTwo to double
4646 %dpi = cast float %pi to double
4747 %dfive = cast float %five to double
4848
49 %castFmt = getelementptr [44 x sbyte]* %fmtArg, uint 0, uint 0
49 %castFmt = getelementptr [44 x sbyte]* %fmtArg, long 0, long 0
5050 call int (sbyte*, ...)* %printf(sbyte* %castFmt, double %dsqrtTwo, double %dexp, double %dpi, double %dfive)
5151
5252 ret int 0
4040 %i = add uint 1, 0 ; i = 1
4141 %iscale = mul uint %i, 4294967295 ; i*-1 = -1
4242 %ioff = add uint %iscale, 3 ; 3+(-i) = 2
43 %fptr = getelementptr %Results* %fval, uint %ioff ; &fval[2]
44 %castFmt = getelementptr [39 x sbyte]* %fmtArg, uint 0, uint 0
43 %ioff = cast uint %ioff to long
44 %fptr = getelementptr %Results* %fval, long %ioff ; &fval[2]
45 %castFmt = getelementptr [39 x sbyte]* %fmtArg, long 0, long 0
4546 call int (sbyte*, ...)* %printf(sbyte* %castFmt, uint %ioff, %Results* %fval, %Results* %fptr)
4647 ret int 0
4748 end