diff options
author | Bob Wilson <bob.wilson@apple.com> | 2013-11-15 07:16:09 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2013-11-15 07:16:09 +0000 |
commit | 4b8991424a8967dfdafc1768a9748f67e6c8b36f (patch) | |
tree | 00e4d49727f39d4bbb2d5061bc4e02153349990c /test | |
parent | 728eb5fbea0d082653f67ccac2bab5207b3b1a89 (diff) | |
download | external_llvm-4b8991424a8967dfdafc1768a9748f67e6c8b36f.zip external_llvm-4b8991424a8967dfdafc1768a9748f67e6c8b36f.tar.gz external_llvm-4b8991424a8967dfdafc1768a9748f67e6c8b36f.tar.bz2 |
Reapply "[asan] Poor man's coverage that works with ASan"
I was able to successfully run a bootstrapped LTO build of clang with
r194701, so this change does not seem to be the cause of our failing
buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194789 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Instrumentation/AddressSanitizer/coverage.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Instrumentation/AddressSanitizer/coverage.ll b/test/Instrumentation/AddressSanitizer/coverage.ll new file mode 100644 index 0000000..47a54c0 --- /dev/null +++ b/test/Instrumentation/AddressSanitizer/coverage.ll @@ -0,0 +1,13 @@ +; RUN: opt < %s -asan -asan-coverage=1 -S | FileCheck %s +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" +define i32 @foo(i32* %a) sanitize_address { +entry: + ret i32 0 +} +; CHECK: define i32 @foo(i32* %a) #0 { +; CHECK: %0 = load atomic i8* @__asan_gen_cov_foo monotonic, align 1 +; CHECK: %1 = icmp eq i8 0, %0 +; CHECK: br i1 %1, label %2, label %3 +; CHECK: call void @__sanitizer_cov(i64 ptrtoint (i32 (i32*)* @foo to i64)) +; CHECK: store atomic i8 1, i8* @__asan_gen_cov_foo monotonic, align 1 |