Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / CodeGen / PowerPC / mem_update.ll
1 ; 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
5 %Glob = global ulong 4
6
7 int *%test0(int *%X,  int *%dest) {
8         %Y = getelementptr int* %X, int 4
9         %A = load int* %Y
10         store int %A, int* %dest
11         ret int* %Y
12 }
13
14 int *%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
21 short *%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
29 ushort *%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
37 short *%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 }
44
45 long *%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 }
51
52 ushort *%test5(ushort *%X) {
53         %Y = getelementptr ushort* %X, int 4
54         store ushort 7, ushort* %Y
55         ret ushort* %Y
56 }
57
58 ulong *%test6(ulong *%X, ulong %A) {
59         %Y = getelementptr ulong* %X, int 4
60         store ulong %A, ulong* %Y
61         ret ulong* %Y
62 }
63
64 ulong *%test7(ulong *%X, ulong %A) {
65         store ulong %A, ulong* %Glob
66         ret ulong *%Glob
67 }
68