summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/2008-10-23-ConstFoldWithoutMask.ll
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-10-24 06:14:27 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-10-24 06:14:27 +0000
commit04aa2c3520c049333ca216fb794d700310c4a33d (patch)
treeb658f4581ef7cb57b7b65d7bba010256b8c1887d /test/Transforms/InstCombine/2008-10-23-ConstFoldWithoutMask.ll
parent2efe3fd79a751eabe1664109a004af45dca99274 (diff)
downloadllvm-04aa2c3520c049333ca216fb794d700310c4a33d.tar.gz
llvm-04aa2c3520c049333ca216fb794d700310c4a33d.tar.bz2
llvm-04aa2c3520c049333ca216fb794d700310c4a33d.tar.xz
Don't try to create a mask when we don't need one. Fixes a crash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58075 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/2008-10-23-ConstFoldWithoutMask.ll')
-rw-r--r--test/Transforms/InstCombine/2008-10-23-ConstFoldWithoutMask.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2008-10-23-ConstFoldWithoutMask.ll b/test/Transforms/InstCombine/2008-10-23-ConstFoldWithoutMask.ll
new file mode 100644
index 0000000000..8f35a8586c
--- /dev/null
+++ b/test/Transforms/InstCombine/2008-10-23-ConstFoldWithoutMask.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | opt -instcombine
+; PR2940
+
+define i32 @tstid() {
+ %var0 = inttoptr i32 1 to i8* ; <i8*> [#uses=1]
+ %var2 = ptrtoint i8* %var0 to i32 ; <i32> [#uses=1]
+ ret i32 %var2
+}