From acbc9cb577e816c57c37c95b7dddb4cad835b0ba Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Mon, 21 Apr 2014 11:57:43 +0000 Subject: [asan] add llvm-ish test for memset/etc instrumentation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206747 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Instrumentation/AddressSanitizer/basic.ll | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/Instrumentation') diff --git a/test/Instrumentation/AddressSanitizer/basic.ll b/test/Instrumentation/AddressSanitizer/basic.ll index 4863a3dea9..7a125a3964 100644 --- a/test/Instrumentation/AddressSanitizer/basic.ll +++ b/test/Instrumentation/AddressSanitizer/basic.ll @@ -139,4 +139,21 @@ entry: ; CHECK-NOT: __asan_report ; CHECK: ret i32 +declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind +declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) nounwind +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) nounwind + +define void @memintr_test(i8* %a, i8* %b) nounwind uwtable sanitize_address { + entry: + tail call void @llvm.memset.p0i8.i64(i8* %a, i8 0, i64 100, i32 1, i1 false) + tail call void @llvm.memmove.p0i8.p0i8.i64(i8* %a, i8* %b, i64 100, i32 1, i1 false) + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* %b, i64 100, i32 1, i1 false) + ret void +} + +; CHECK-LABEL: memintr_test +; CHECK: __asan_memset +; CHECK: __asan_memmove +; CHECK: __asan_memcpy +; CHECK: ret void -- cgit v1.2.3