aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-03-28 01:43:35 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-03-28 01:43:35 +0000
commit12fa2224e4639435953c2e7e942fb63ac5ee959a (patch)
tree0fe78b8cb37af54e3b1097a2a6ca343ef87eaa09
parent35c3885ba1b7a5cf8d58ebc0bbd749a1e794eed5 (diff)
new test case for PR1280
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35401 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Transforms/InstCombine/2007-03-27-PR1280.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2007-03-27-PR1280.ll b/test/Transforms/InstCombine/2007-03-27-PR1280.ll
new file mode 100644
index 0000000000..9505751c8d
--- /dev/null
+++ b/test/Transforms/InstCombine/2007-03-27-PR1280.ll
@@ -0,0 +1,15 @@
+; PR1280 - we should be able to reduce this function to a trunc/sext but it
+; would involve using a bit width (24) that doesn't match a size that
+; the back end can handle. This test makes sure that such a transform
+; is not done. It should be removed when code gen supports "funny"
+; bit widths.
+
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'add i49.*-8388608'
+
+define i49 @test5(i49 %x) {
+ ;; If we have ADD(XOR(AND(X, 0xFF), 0x80), 0xF..F80), it's a sext.
+ %X = and i49 %x, 16777215 ; 0x0000000ffffff
+ %tmp.2 = xor i49 %X, 8388608 ; 0x0000000800000
+ %tmp.4 = add i49 %tmp.2, -8388608 ; 0x1FFFFFF800000
+ ret i49 %tmp.4
+}