summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-15 06:51:25 +0000
committerChris Lattner <sabre@nondot.org>2007-01-15 06:51:25 +0000
commit8938a7c93011e02d9bd767b88c091e7700f82834 (patch)
treecff6bcb1ac1cfae126bbb301c6f89f2a76d99947
parent26933ddb10ce7d8f16bfccd7ddc8e1bf61c3376b (diff)
downloadbcm5719-llvm-8938a7c93011e02d9bd767b88c091e7700f82834.tar.gz
bcm5719-llvm-8938a7c93011e02d9bd767b88c091e7700f82834.zip
add a simple case where instcombine can detect and remove a dead alloca
llvm-svn: 33230
-rw-r--r--llvm/test/Regression/Transforms/InstCombine/alloca.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/Regression/Transforms/InstCombine/alloca.ll b/llvm/test/Regression/Transforms/InstCombine/alloca.ll
index c5d78182297..8ce7b65b0c0 100644
--- a/llvm/test/Regression/Transforms/InstCombine/alloca.ll
+++ b/llvm/test/Regression/Transforms/InstCombine/alloca.ll
@@ -12,3 +12,16 @@ void %test() {
call void(...)* %use({}* %Z)
ret void
}
+
+void %test2() {
+ %A = alloca int ;; dead.
+ store int 123, int* %A
+ ret void
+}
+
+void %test3() {
+ %A = alloca {int} ;; dead.
+ %B = getelementptr {int}* %A, int 0, uint 0
+ store int 123, int* %B
+ ret void
+}
OpenPOWER on IntegriCloud