diff options
| author | Kostya Serebryany <kcc@google.com> | 2014-11-11 22:14:37 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2014-11-11 22:14:37 +0000 |
| commit | 29a18dcbc531a0a30c9cabbb4e02b306d95d4f9b (patch) | |
| tree | 76432df6f4f85f474930d0f27ebd06ad5571c997 /llvm/test | |
| parent | eb63c5e28c29fdc15370caae51b35f089a584aff (diff) | |
| download | bcm5719-llvm-29a18dcbc531a0a30c9cabbb4e02b306d95d4f9b.tar.gz bcm5719-llvm-29a18dcbc531a0a30c9cabbb4e02b306d95d4f9b.zip | |
Move asan-coverage into a separate phase.
Summary:
This change moves asan-coverage instrumentation
into a separate Module pass.
The other part of the change in clang introduces a new flag
-fsanitize-coverage=N.
Another small patch will update tests in compiler-rt.
With this patch no functionality change is expected except for the flag name.
The following changes will make the coverage instrumentation work with tsan/msan
Test Plan: Run regression tests, chromium.
Reviewers: nlewycky, samsonov
Reviewed By: nlewycky, samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6152
llvm-svn: 221718
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Instrumentation/SanitizerCoverage/coverage-dbg.ll (renamed from llvm/test/Instrumentation/AddressSanitizer/coverage-dbg.ll) | 2 | ||||
| -rw-r--r-- | llvm/test/Instrumentation/SanitizerCoverage/coverage.ll (renamed from llvm/test/Instrumentation/AddressSanitizer/coverage.ll) | 39 | ||||
| -rw-r--r-- | llvm/test/Instrumentation/SanitizerCoverage/coverage2-dbg.ll (renamed from llvm/test/Instrumentation/AddressSanitizer/coverage2-dbg.ll) | 2 |
3 files changed, 20 insertions, 23 deletions
diff --git a/llvm/test/Instrumentation/AddressSanitizer/coverage-dbg.ll b/llvm/test/Instrumentation/SanitizerCoverage/coverage-dbg.ll index ef40a778163..eea93b8a44b 100644 --- a/llvm/test/Instrumentation/AddressSanitizer/coverage-dbg.ll +++ b/llvm/test/Instrumentation/SanitizerCoverage/coverage-dbg.ll @@ -1,6 +1,6 @@ ; Test that coverage instrumentation does not lose debug location. -; RUN: opt < %s -asan -asan-module -asan-coverage=1 -S | FileCheck %s +; RUN: opt < %s -sancov -sanitizer-coverage-level=1 -S | FileCheck %s ; C++ source: ; 1: struct A { diff --git a/llvm/test/Instrumentation/AddressSanitizer/coverage.ll b/llvm/test/Instrumentation/SanitizerCoverage/coverage.ll index d3de7d22d59..a3b1131968a 100644 --- a/llvm/test/Instrumentation/AddressSanitizer/coverage.ll +++ b/llvm/test/Instrumentation/SanitizerCoverage/coverage.ll @@ -1,21 +1,18 @@ -; RUN: opt < %s -asan -asan-module -asan-coverage=0 -S | FileCheck %s --check-prefix=CHECK0 -; RUN: opt < %s -asan -asan-module -asan-coverage=1 -S | FileCheck %s --check-prefix=CHECK1 -; RUN: opt < %s -asan -asan-module -asan-coverage=2 -S | FileCheck %s --check-prefix=CHECK2 -; RUN: opt < %s -asan -asan-module -asan-coverage=2 -asan-coverage-block-threshold=10 -S | FileCheck %s --check-prefix=CHECK2 -; RUN: opt < %s -asan -asan-module -asan-coverage=2 -asan-coverage-block-threshold=1 -S | FileCheck %s --check-prefix=CHECK1 -; RUN: opt < %s -asan -asan-module -asan-coverage=3 -asan-coverage-block-threshold=10 -S | FileCheck %s --check-prefix=CHECK3 -; RUN: opt < %s -asan -asan-module -asan-coverage=4 -S | FileCheck %s --check-prefix=CHECK4 +; RUN: opt < %s -sancov -sanitizer-coverage-level=0 -S | FileCheck %s --check-prefix=CHECK0 +; RUN: opt < %s -sancov -sanitizer-coverage-level=1 -S | FileCheck %s --check-prefix=CHECK1 +; RUN: opt < %s -sancov -sanitizer-coverage-level=2 -S | FileCheck %s --check-prefix=CHECK2 +; RUN: opt < %s -sancov -sanitizer-coverage-level=2 -sanitizer-coverage-block-threshold=10 -S | FileCheck %s --check-prefix=CHECK2 +; RUN: opt < %s -sancov -sanitizer-coverage-level=2 -sanitizer-coverage-block-threshold=1 -S | FileCheck %s --check-prefix=CHECK1 +; RUN: opt < %s -sancov -sanitizer-coverage-level=3 -sanitizer-coverage-block-threshold=10 -S | FileCheck %s --check-prefix=CHECK3 +; RUN: opt < %s -sancov -sanitizer-coverage-level=4 -S | FileCheck %s --check-prefix=CHECK4 -; RUN: opt < %s -asan -asan-module -asan-coverage=0 -asan-globals=0 -S | \ -; RUN: FileCheck %s --check-prefix=CHECK0 -; RUN: opt < %s -asan -asan-module -asan-coverage=1 -asan-globals=0 -S | \ -; RUN: FileCheck %s --check-prefix=CHECK1 -; RUN: opt < %s -asan -asan-module -asan-coverage=2 -asan-globals=0 -S | \ -; RUN: FileCheck %s --check-prefix=CHECK2 -; RUN: opt < %s -asan -asan-module -asan-coverage=2 -asan-coverage-block-threshold=10 \ -; RUN: -asan-globals=0 -S | FileCheck %s --check-prefix=CHECK2 -; RUN: opt < %s -asan -asan-module -asan-coverage=2 -asan-coverage-block-threshold=1 \ -; RUN: -asan-globals=0 -S | FileCheck %s --check-prefix=CHECK1 +; RUN: opt < %s -sancov -sanitizer-coverage-level=0 -S | FileCheck %s --check-prefix=CHECK0 +; RUN: opt < %s -sancov -sanitizer-coverage-level=1 -S | FileCheck %s --check-prefix=CHECK1 +; RUN: opt < %s -sancov -sanitizer-coverage-level=2 -S | FileCheck %s --check-prefix=CHECK2 +; RUN: opt < %s -sancov -sanitizer-coverage-level=2 -sanitizer-coverage-block-threshold=10 \ +; RUN: -S | FileCheck %s --check-prefix=CHECK2 +; RUN: opt < %s -sancov -sanitizer-coverage-level=2 -sanitizer-coverage-block-threshold=1 \ +; RUN: -S | FileCheck %s --check-prefix=CHECK1 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" @@ -36,14 +33,14 @@ entry: ; CHECK0-NOT: call void @__sanitizer_cov_module_init( ; CHECK1-LABEL: define void @foo -; CHECK1: %0 = load atomic i8* @__asan_gen_cov_foo monotonic, align 1 +; CHECK1: %0 = load atomic i8* @__sancov_gen_cov_foo monotonic, align 1 ; CHECK1: %1 = icmp eq i8 0, %0 ; CHECK1: br i1 %1, label %2, label %3 ; CHECK1: call void @__sanitizer_cov ; CHECK1-NOT: call void @__sanitizer_cov -; CHECK1: store atomic i8 1, i8* @__asan_gen_cov_foo monotonic, align 1 +; CHECK1: store atomic i8 1, i8* @__sancov_gen_cov_foo monotonic, align 1 -; CHECK1-LABEL: define internal void @asan.module_ctor +; CHECK1-LABEL: define internal void @sancov.module_ctor ; CHECK1-NOT: ret ; CHECK1: call void @__sanitizer_cov_module_init(i64 2) ; CHECK1: ret @@ -56,7 +53,7 @@ entry: ; CHECK2-NOT: call void @__sanitizer_cov ; CHECK2: ret void -; CHECK2-LABEL: define internal void @asan.module_ctor +; CHECK2-LABEL: define internal void @sancov.module_ctor ; CHECK2-NOT: ret ; CHECK2: call void @__sanitizer_cov_module_init(i64 4) ; CHECK2: ret diff --git a/llvm/test/Instrumentation/AddressSanitizer/coverage2-dbg.ll b/llvm/test/Instrumentation/SanitizerCoverage/coverage2-dbg.ll index 2b0f7ef0fac..9b263293bf4 100644 --- a/llvm/test/Instrumentation/AddressSanitizer/coverage2-dbg.ll +++ b/llvm/test/Instrumentation/SanitizerCoverage/coverage2-dbg.ll @@ -1,6 +1,6 @@ ; Test that coverage instrumentation does not lose debug location. -; RUN: opt < %s -asan -asan-module -asan-coverage=2 -S | FileCheck %s +; RUN: opt < %s -sancov -sanitizer-coverage-level=2 -S | FileCheck %s ; C++ source: ; 1: void foo(int *a) { |

