Fix a bug in GetKnownAlignment of packed structs.
[oota-llvm.git] / test / CodeGen / PowerPC / or-addressing-mode.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc-apple-darwin8 | not grep ori
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc-apple-darwin8 | not grep rlwimi
3
4 int %test1(sbyte* %P) {  ;; or -> lwzx
5         %tmp.2.i = cast sbyte* %P to uint
6         %tmp.4.i = and uint %tmp.2.i, 4294901760
7         %tmp.10.i = shr uint %tmp.2.i, ubyte 5
8         %tmp.11.i = and uint %tmp.10.i, 2040
9         %tmp.13.i = or uint %tmp.11.i, %tmp.4.i
10         %tmp.14.i = cast uint %tmp.13.i to int*
11         %tmp.3 = load int* %tmp.14.i
12         ret int %tmp.3
13 }
14
15 int %test2(int %P) {    ;; or -> lwz
16         %tmp.2 = shl int %P, ubyte 4
17         %tmp.3 = or int %tmp.2, 2
18         %tmp.4 = cast int %tmp.3 to int*
19         %tmp.5 = load int* %tmp.4
20         ret int %tmp.5
21 }
22