summaryrefslogtreecommitdiff
path: root/test/CodeGen/PowerPC/fold-li.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-09-28 23:03:11 +0000
committerChris Lattner <sabre@nondot.org>2005-09-28 23:03:11 +0000
commit3a972c2951061ae8c8ba4bbfc71a0f113f2fbb37 (patch)
treea0d01317c678ba5c55c1c0fe8ebaa36c4e79d9b1 /test/CodeGen/PowerPC/fold-li.ll
parentd8ead9e25021d5c07b222f8550b621b4f31c874f (diff)
downloadllvm-3a972c2951061ae8c8ba4bbfc71a0f113f2fbb37.tar.gz
llvm-3a972c2951061ae8c8ba4bbfc71a0f113f2fbb37.tar.bz2
llvm-3a972c2951061ae8c8ba4bbfc71a0f113f2fbb37.tar.xz
add a testcase for a feature we regressed on because noone wrote the test! :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23513 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PowerPC/fold-li.ll')
-rw-r--r--test/CodeGen/PowerPC/fold-li.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/fold-li.ll b/test/CodeGen/PowerPC/fold-li.ll
new file mode 100644
index 0000000000..725f1d4848
--- /dev/null
+++ b/test/CodeGen/PowerPC/fold-li.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -march=ppc32 &&
+; RUN: llvm-as < %s | llc -march=ppc32 | grep -v align | not grep li
+
+;; Test that immediates are folded into these instructions correctly.
+
+int %ADD(int %X) {
+ %Y = add int %X, 65537
+ ret int %Y
+}
+
+int %SUB(int %X) {
+ %Y = sub int %X, 65537
+ ret int %Y
+}