diff options
author | Chris Lattner <sabre@nondot.org> | 2007-12-10 22:53:04 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-12-10 22:53:04 +0000 |
commit | d6e569110ab0ff7846c184f1c92effd798ff39a8 (patch) | |
tree | 400c56bd0a897bc94b6b69e53505a2d1074cdb57 /test/Transforms | |
parent | 844fad5f440c7a69112c2f8f17bbc488232a6893 (diff) | |
download | external_llvm-d6e569110ab0ff7846c184f1c92effd798ff39a8.zip external_llvm-d6e569110ab0ff7846c184f1c92effd798ff39a8.tar.gz external_llvm-d6e569110ab0ff7846c184f1c92effd798ff39a8.tar.bz2 |
Fix PR1850 by removing an unsafe transformation from VMCore/ConstantFold.cpp.
Reimplement the xform in Analysis/ConstantFolding.cpp where we can use
targetdata to validate that it is safe. While I'm in there, fix some const
correctness issues and generalize the interface to the "operand folder".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll b/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll new file mode 100644 index 0000000..80df6fb --- /dev/null +++ b/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll @@ -0,0 +1,9 @@ +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" +target triple = "i686-pc-linux-gnu" +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {ret i1 0} +; PR1850 + +define i1 @test() { + %cond = icmp ule i8* inttoptr (i64 4294967297 to i8*), inttoptr (i64 5 to i8*) + ret i1 %cond +} |