blob: 2a8f83fbd36c7e7bf9f487f15fbf0b05e68fc570 [file] [log] [blame]
Reid Spencer69ccadd2006-12-02 04:23:10 +00001; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -enable-ppc-preinc &&
2; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -enable-ppc-preinc | not grep addi &&
3; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 -enable-ppc-preinc &&
4; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 -enable-ppc-preinc | not grep addi
Chris Lattner027f3882006-11-16 01:22:52 +00005%Glob = global ulong 4
Chris Lattner97a6e8c2006-11-08 01:44:35 +00006
Chris Lattner42b51e42006-11-10 02:04:52 +00007int *%test0(int *%X, int *%dest) {
Chris Lattner97a6e8c2006-11-08 01:44:35 +00008 %Y = getelementptr int* %X, int 4
9 %A = load int* %Y
10 store int %A, int* %dest
11 ret int* %Y
12}
Chris Lattner42b51e42006-11-10 02:04:52 +000013
14int *%test1(int *%X, int *%dest) {
15 %Y = getelementptr int* %X, int 4
16 %A = load int* %Y
17 store int %A, int* %dest
18 ret int* %Y
19}
20
21short *%test2(short *%X, int *%dest) {
22 %Y = getelementptr short* %X, int 4
23 %A = load short* %Y
24 %B = cast short %A to int
25 store int %B, int* %dest
26 ret short* %Y
27}
28
29ushort *%test3(ushort *%X, int *%dest) {
30 %Y = getelementptr ushort* %X, int 4
31 %A = load ushort* %Y
32 %B = cast ushort %A to int
33 store int %B, int* %dest
34 ret ushort* %Y
35}
36
Chris Lattner027f3882006-11-16 01:22:52 +000037short *%test3a(short *%X, long *%dest) {
38 %Y = getelementptr short* %X, int 4
39 %A = load short* %Y
40 %B = cast short %A to long
41 store long %B, long* %dest
42 ret short* %Y
43}
Chris Lattner42b51e42006-11-10 02:04:52 +000044
45long *%test4(long *%X, long *%dest) {
46 %Y = getelementptr long* %X, int 4
47 %A = load long* %Y
48 store long %A, long* %dest
49 ret long* %Y
50}
Chris Lattner027f3882006-11-16 01:22:52 +000051
52ushort *%test5(ushort *%X) {
53 %Y = getelementptr ushort* %X, int 4
54 store ushort 7, ushort* %Y
55 ret ushort* %Y
56}
57
58ulong *%test6(ulong *%X, ulong %A) {
59 %Y = getelementptr ulong* %X, int 4
60 store ulong %A, ulong* %Y
61 ret ulong* %Y
62}
63
64ulong *%test7(ulong *%X, ulong %A) {
65 store ulong %A, ulong* %Glob
66 ret ulong *%Glob
67}
68