From 90bb12c2e73a5f1ab22036fe0694a14cdcc6434e Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Wed, 28 Mar 2007 01:43:35 +0000 Subject: [PATCH] new test case for PR1280 llvm-svn: 35401 --- .../Transforms/InstCombine/2007-03-27-PR1280.ll | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 llvm/test/Transforms/InstCombine/2007-03-27-PR1280.ll diff --git a/llvm/test/Transforms/InstCombine/2007-03-27-PR1280.ll b/llvm/test/Transforms/InstCombine/2007-03-27-PR1280.ll new file mode 100644 index 000000000000..9505751c8d3a --- /dev/null +++ b/llvm/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 +}