aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/LevelRaise
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-03-11 22:14:26 +0000
committerChris Lattner <sabre@nondot.org>2002-03-11 22:14:26 +0000
commit1340f7671ce3b40c0f6b4ad874c5ec2aeb4552e5 (patch)
treed9818c7505da1ae67b677af609d35f6f9125fd35 /test/Transforms/LevelRaise
parent749ce032ba2ad79bdbaf89b924f12baebac1d062 (diff)
downloadexternal_llvm-1340f7671ce3b40c0f6b4ad874c5ec2aeb4552e5.zip
external_llvm-1340f7671ce3b40c0f6b4ad874c5ec2aeb4552e5.tar.gz
external_llvm-1340f7671ce3b40c0f6b4ad874c5ec2aeb4552e5.tar.bz2
New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1860 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LevelRaise')
-rw-r--r--test/Transforms/LevelRaise/2002-03-11-IterInvalidate.ll47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/Transforms/LevelRaise/2002-03-11-IterInvalidate.ll b/test/Transforms/LevelRaise/2002-03-11-IterInvalidate.ll
new file mode 100644
index 0000000..774f702
--- /dev/null
+++ b/test/Transforms/LevelRaise/2002-03-11-IterInvalidate.ll
@@ -0,0 +1,47 @@
+; Assertion failure in LevelRaise caused by this code:
+;
+; LevelRaise.cpp:92: failed assertion `I->getOpcode() == Instruction::Add && I->getNumOperands() == 2 && "Use is not a valid add instruction!"'
+;
+; RUN: as < %s | opt -raise
+
+%lit_base = uninitialized global [26 x int] ; <[26 x int] *> [#uses=1]
+%leaves = uninitialized global [26 x int] ; <[26 x int] *> [#uses=1]
+%parents = uninitialized global [26 x int] ; <[26 x int] *> [#uses=1]
+implementation
+
+int "build_tree"(int %ml)
+begin
+; <label>:0 ;[#uses=2]
+ %ml = alloca int ; <int *> [#uses=2]
+ store int %ml, int * %ml
+ %reg107 = load int * %ml ; <int> [#uses=1]
+ br label %bb2
+
+bb2: ;[#uses=4]
+ %reg137 = phi int [ %reg140, %bb2 ], [ %reg107, %0 ] ; <int> [#uses=2]
+ %reg138 = phi uint [ %reg139, %bb2 ], [ 0, %0 ] ; <uint> [#uses=3]
+ %cast1005 = cast int %reg137 to uint ; <uint> [#uses=1]
+ %reg111 = shl uint %cast1005, ubyte 2 ; <uint> [#uses=1]
+ %cast112 = cast uint %reg111 to sbyte * ; <sbyte *> [#uses=3]
+ %cast1002 = cast [26 x int] * %parents to sbyte * ; <sbyte *> [#uses=1]
+ %reg115 = add sbyte * %cast112, %cast1002 ; <sbyte *> [#uses=1]
+ ;%cast1006 = cast sbyte * %reg115 to uint * ; <uint *> [#uses=1]
+
+ %cast1003 = cast [26 x int] * %lit_base to sbyte * ; <sbyte *> [#uses=1]
+ %reg121 = add sbyte * %cast112, %cast1003 ; <sbyte *> [#uses=2]
+ %cast1007 = cast sbyte * %reg121 to uint * ; <uint *> [#uses=1]
+ %reg128 = load uint * %cast1007 ; <uint> [#uses=1]
+ %reg129 = sub uint %reg128, %reg138 ; <uint> [#uses=1]
+ %cast1008 = cast sbyte * %reg121 to uint * ; <uint *> [#uses=1]
+ ;store uint %reg129, uint * %cast1008
+ %cast1004 = cast [26 x int] * %leaves to sbyte * ; <sbyte *> [#uses=1]
+ %reg135 = add sbyte * %cast112, %cast1004 ; <sbyte *> [#uses=1]
+ %cast1009 = cast sbyte * %reg135 to uint * ; <uint *> [#uses=1]
+ %reg136 = load uint * %cast1009 ; <uint> [#uses=1]
+ %reg139 = add uint %reg138, %reg136 ; <uint> [#uses=1]
+ %reg140 = add int %reg137, -1 ; <int> [#uses=1]
+ br bool false, label %bb2, label %bb3
+
+bb3: ;[#uses=1]
+ ret int %reg137
+end