aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-07-16 19:10:00 +0000
committerChris Lattner <sabre@nondot.org>2002-07-16 19:10:00 +0000
commitc2c5a6428ddf68ec101a2fe66837c3bbf974f67e (patch)
tree90f27b8af8cc60c73f749b083c7a35e110c64d55
parentb3ce2f99fc89ca5370c10ce455f5f239070a7ffb (diff)
Add testcase for raise opportunity missed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2930 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Transforms/LevelRaise/2002-07-16-MissedRaise.ll25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/Transforms/LevelRaise/2002-07-16-MissedRaise.ll b/test/Transforms/LevelRaise/2002-07-16-MissedRaise.ll
new file mode 100644
index 0000000000..4aec440b94
--- /dev/null
+++ b/test/Transforms/LevelRaise/2002-07-16-MissedRaise.ll
@@ -0,0 +1,25 @@
+; This case fails raise because the store requires that it's argument is of a
+; particular type, but the gep is unable to propogate types backwards through
+; it, because it doesn't know what type to ask it's operand to be.
+;
+; This could be fixed by making all stores add themselves to a list, and check
+; their arguments are consistent AFTER all other values are propogated.
+
+; RUN: if as < %s | opt -raise | dis | grep '= cast'
+; RUN: then exit 1
+; RUN: else exit 0
+; RUN: fi
+
+ %Tree = type %struct.tree*
+ %struct.tree = type { int, double, double, %Tree, %Tree, %Tree, %Tree }
+
+void %reverse(%Tree %t) {
+bb0: ;[#uses=0]
+ %cast219 = cast %Tree %t to sbyte*** ; <sbyte***> [#uses=2]
+ %reg2221 = getelementptr sbyte*** %cast219, uint 6 ; <sbyte***> [#uses=1]
+ %reg108 = load sbyte*** %reg2221 ; <sbyte**> [#uses=2]
+ %reg247 = getelementptr sbyte*** %cast219, uint 5 ; <sbyte***> [#uses=1]
+ store sbyte** %reg108, sbyte*** %reg247
+ ret void
+}
+