aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/LevelRaise/2002-03-21-MissedRaise.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-03-21 21:20:04 +0000
committerChris Lattner <sabre@nondot.org>2002-03-21 21:20:04 +0000
commit6e848eac1be1859888e99de3535e5b6180624497 (patch)
tree25ed4839d3c567a923ae715fb23d1af6420db7be /test/Transforms/LevelRaise/2002-03-21-MissedRaise.ll
parent9e77f7e08b4241b810a3cccafb3d56dc256e0d1b (diff)
downloadexternal_llvm-6e848eac1be1859888e99de3535e5b6180624497.zip
external_llvm-6e848eac1be1859888e99de3535e5b6180624497.tar.gz
external_llvm-6e848eac1be1859888e99de3535e5b6180624497.tar.bz2
Testcase for a missed level raise opportunity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1932 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LevelRaise/2002-03-21-MissedRaise.ll')
-rw-r--r--test/Transforms/LevelRaise/2002-03-21-MissedRaise.ll25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/Transforms/LevelRaise/2002-03-21-MissedRaise.ll b/test/Transforms/LevelRaise/2002-03-21-MissedRaise.ll
new file mode 100644
index 0000000..8478036
--- /dev/null
+++ b/test/Transforms/LevelRaise/2002-03-21-MissedRaise.ll
@@ -0,0 +1,25 @@
+; This example should be raised to return a Hash directly without casting. To
+; successful, all cast instructions should be eliminated from this testcase.
+;
+
+; RUN: if as < %s | opt -raise | dis | grep cast
+; RUN: then exit 1
+; RUN: else exit 0
+; RUN: fi
+
+ %Hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int } *
+ %hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int }
+ %hash_el = type { uint, sbyte *, \2 } *
+implementation
+
+%Hash "MakeHash"(int %size, int (uint) * %map)
+begin
+ %reg112 = malloc sbyte, uint 24 ; <sbyte *> [#uses=5]
+ %reg115 = malloc sbyte, uint 96 ; <sbyte *> [#uses=1]
+ %cast237 = cast sbyte * %reg112 to sbyte * * ; <sbyte * *> [#uses=1]
+ store sbyte * %reg115, sbyte * * %cast237
+
+ %cast246 = cast sbyte * %reg112 to %Hash ; <%Hash> [#uses=1]
+ ret %Hash %cast246
+end
+