summaryrefslogtreecommitdiff
path: root/test/Instrumentation
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2012-10-19 06:20:53 +0000
committerKostya Serebryany <kcc@google.com>2012-10-19 06:20:53 +0000
commitbd0052a0f26f04b8fcf59e8f645e5e33751e1f6e (patch)
treeabadccd16f7d0ee24be4554fad2307dd2996fcd8 /test/Instrumentation
parent725f1d12801109a3b1d081a6e1c9e44426b2cf34 (diff)
downloadllvm-bd0052a0f26f04b8fcf59e8f645e5e33751e1f6e.tar.gz
llvm-bd0052a0f26f04b8fcf59e8f645e5e33751e1f6e.tar.bz2
llvm-bd0052a0f26f04b8fcf59e8f645e5e33751e1f6e.tar.xz
[asan] make sure asan erases old unused allocas after it created a new one. This became important after the recent move from ModulePass to FunctionPass because no cleanup is happening after asan pass any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Instrumentation')
-rw-r--r--test/Instrumentation/AddressSanitizer/basic.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Instrumentation/AddressSanitizer/basic.ll b/test/Instrumentation/AddressSanitizer/basic.ll
index d190001870..655f69c16f 100644
--- a/test/Instrumentation/AddressSanitizer/basic.ll
+++ b/test/Instrumentation/AddressSanitizer/basic.ll
@@ -69,3 +69,23 @@ entry:
store i32 42, i32* %a
ret void
}
+
+; Check that asan leaves just one alloca.
+
+declare void @alloca_test_use([10 x i8]*)
+define void @alloca_test() address_safety {
+entry:
+ %x = alloca [10 x i8], align 1
+ %y = alloca [10 x i8], align 1
+ %z = alloca [10 x i8], align 1
+ call void @alloca_test_use([10 x i8]* %x)
+ call void @alloca_test_use([10 x i8]* %y)
+ call void @alloca_test_use([10 x i8]* %z)
+ ret void
+}
+
+; CHECK: define void @alloca_test()
+; CHECK: = alloca
+; CHECK-NOT: = alloca
+; CHECK: ret void
+