Add regression test to make sure that constants are generated optimally.
[oota-llvm.git] / test / CodeGen / PowerPC / constants.ll
1 ; All of these ands and shifts should be folded into constants's
2 ; RUN: llvm-as < constants.ll | llc -march=ppc32 | grep lis | wc -l | grep 5 &&
3 ; RUN: llvm-as < constants.ll | llc -march=ppc32 | grep ori | wc -l | grep 3 &&
4 ; RUN: llvm-as < constants.ll | llc -march=ppc32 | grep li | wc -l | grep 18
5
6 implementation   ; Functions:
7
8 int %_Z2f1v() {
9 entry:
10         ret int 1
11 }
12
13 int %_Z2f2v() {
14 entry:
15         ret int -1
16 }
17
18 int %_Z2f3v() {
19 entry:
20         ret int 0
21 }
22
23 int %_Z2f4v() {
24 entry:
25         ret int 32767
26 }
27
28 int %_Z2f5v() {
29 entry:
30         ret int 65535
31 }
32
33 int %_Z2f6v() {
34 entry:
35         ret int 65536
36 }
37
38 int %_Z2f7v() {
39 entry:
40         ret int 131071
41 }
42
43 int %_Z2f8v() {
44 entry:
45         ret int 2147483647
46 }
47
48 int %_Z2f9v() {
49 entry:
50         ret int -2147483648
51 }