aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-03-21 22:39:43 +0000
committerChris Lattner <sabre@nondot.org>2002-03-21 22:39:43 +0000
commit41e8e9deead5ad0c3d574d3fa865a3f7c008bf92 (patch)
treeabac9c69756e175b1a4aadd897edd1e616938745 /test/Transforms
parent4fe130c22b2426bda067326a212922bace15778d (diff)
downloadexternal_llvm-41e8e9deead5ad0c3d574d3fa865a3f7c008bf92.zip
external_llvm-41e8e9deead5ad0c3d574d3fa865a3f7c008bf92.tar.gz
external_llvm-41e8e9deead5ad0c3d574d3fa865a3f7c008bf92.tar.bz2
New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1940 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/LevelRaise/2002-03-21-MissedRaise2.ll32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/Transforms/LevelRaise/2002-03-21-MissedRaise2.ll b/test/Transforms/LevelRaise/2002-03-21-MissedRaise2.ll
new file mode 100644
index 0000000..8c3e664
--- /dev/null
+++ b/test/Transforms/LevelRaise/2002-03-21-MissedRaise2.ll
@@ -0,0 +1,32 @@
+; Problem that occured because of obsolete code that only allowed malloc
+; instructions to change type if they were 'array' allocations. This
+; prevented reg115 from being able to change.
+;
+
+; RUN: if as < %s | opt -raise | dis | grep '= cast' | grep \*
+; RUN: then exit 1
+; RUN: else exit 0
+; RUN: fi
+
+ %Hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int } *
+ %HashEntry = type { uint, sbyte *, \2 } *
+ %hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int }
+ %hash_entry = type { uint, sbyte *, \2 * }
+implementation
+
+%Hash "MakeHash"(int %size, int (uint) * %map)
+begin
+bb1: ;[#uses=0]
+ %reg112 = malloc sbyte * *, uint 3 ; <sbyte * * *> [#uses=4]
+ %reg115 = malloc sbyte *, uint 1 ; <sbyte * *> [#uses=1]
+ store sbyte * * %reg115, sbyte * * * %reg112
+ %reg121 = load sbyte * * * %reg112 ; <sbyte * *> [#uses=1]
+ %size-idxcast1 = cast int %size to uint ; <uint> [#uses=1]
+ %reg1221 = getelementptr sbyte * * %reg121, uint %size-idxcast1 ; <sbyte * *> [#uses=1]
+ store sbyte * null, sbyte * * %reg1221
+ %reg232 = getelementptr sbyte * * * %reg112, uint 1 ; <sbyte * * *> [#uses=1]
+ %cast243 = cast int (uint) * %map to sbyte * * ; <sbyte * *> [#uses=1]
+ store sbyte * * %cast243, sbyte * * * %reg232
+ %cast246 = cast sbyte * * * %reg112 to %Hash ; <%Hash> [#uses=1]
+ ret %Hash %cast246
+end