aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2005-08-18 19:32:46 +0000
committerJim Laskey <jlaskey@mac.com>2005-08-18 19:32:46 +0000
commit5a53c2cbfa85dca335a96aaec71e350a430d7740 (patch)
tree4c3c79dd0253bcadbbc0d73539118d15fed210d3
parent5b5f0b7fd5ff6975920e65d4b1b019e456d6e850 (diff)
Add regression test to make sure that constants are generated optimally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22871 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CodeGen/PowerPC/constants.ll51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/constants.ll b/test/CodeGen/PowerPC/constants.ll
new file mode 100644
index 0000000000..a22d970893
--- /dev/null
+++ b/test/CodeGen/PowerPC/constants.ll
@@ -0,0 +1,51 @@
+; All of these ands and shifts should be folded into constants's
+; RUN: llvm-as < constants.ll | llc -march=ppc32 | grep lis | wc -l | grep 5 &&
+; RUN: llvm-as < constants.ll | llc -march=ppc32 | grep ori | wc -l | grep 3 &&
+; RUN: llvm-as < constants.ll | llc -march=ppc32 | grep li | wc -l | grep 18
+
+implementation ; Functions:
+
+int %_Z2f1v() {
+entry:
+ ret int 1
+}
+
+int %_Z2f2v() {
+entry:
+ ret int -1
+}
+
+int %_Z2f3v() {
+entry:
+ ret int 0
+}
+
+int %_Z2f4v() {
+entry:
+ ret int 32767
+}
+
+int %_Z2f5v() {
+entry:
+ ret int 65535
+}
+
+int %_Z2f6v() {
+entry:
+ ret int 65536
+}
+
+int %_Z2f7v() {
+entry:
+ ret int 131071
+}
+
+int %_Z2f8v() {
+entry:
+ ret int 2147483647
+}
+
+int %_Z2f9v() {
+entry:
+ ret int -2147483648
+}