diff options
| author | Matt Morehouse <mascasa@google.com> | 2017-08-30 22:49:31 +0000 |
|---|---|---|
| committer | Matt Morehouse <mascasa@google.com> | 2017-08-30 22:49:31 +0000 |
| commit | 034126e5070a2521b173e5e8377d0dfaca1959a0 (patch) | |
| tree | 1f4028437317dcbc4361177ea42c845587335e85 /llvm/test/Instrumentation/SanitizerCoverage | |
| parent | 06f2f8079165ade13d84b596ee52ac511a7887d3 (diff) | |
| download | bcm5719-llvm-034126e5070a2521b173e5e8377d0dfaca1959a0.tar.gz bcm5719-llvm-034126e5070a2521b173e5e8377d0dfaca1959a0.zip | |
[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
Summary:
- Don't sanitize __sancov_lowest_stack.
- Don't instrument leaf functions.
- Add CoverageStackDepth to Fuzzer and FuzzerNoLink.
- Only enable on Linux.
Reviewers: vitalybuka, kcc, george.karpenkov
Reviewed By: kcc
Subscribers: kubamracek, cfe-commits, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D37156
llvm-svn: 312185
Diffstat (limited to 'llvm/test/Instrumentation/SanitizerCoverage')
| -rw-r--r-- | llvm/test/Instrumentation/SanitizerCoverage/stack-depth.ll | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/llvm/test/Instrumentation/SanitizerCoverage/stack-depth.ll b/llvm/test/Instrumentation/SanitizerCoverage/stack-depth.ll index e88741553d5..878295cd653 100644 --- a/llvm/test/Instrumentation/SanitizerCoverage/stack-depth.ll +++ b/llvm/test/Instrumentation/SanitizerCoverage/stack-depth.ll @@ -1,9 +1,9 @@ ; This check verifies that stack depth instrumentation works correctly. ; RUN: opt < %s -sancov -sanitizer-coverage-level=1 \ -; RUN: -sanitizer-coverage-stack-depth -S | FileCheck %s --enable-var-scope +; RUN: -sanitizer-coverage-stack-depth -S | FileCheck %s ; RUN: opt < %s -sancov -sanitizer-coverage-level=3 \ ; RUN: -sanitizer-coverage-stack-depth -sanitizer-coverage-trace-pc-guard \ -; RUN: -S | FileCheck %s --enable-var-scope +; RUN: -S | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" @@ -14,13 +14,8 @@ target triple = "x86_64-unknown-linux-gnu" define i32 @foo() { entry: ; CHECK-LABEL: define i32 @foo -; CHECK: [[framePtr:%[^ \t]+]] = call i8* @llvm.frameaddress(i32 0) -; CHECK: [[frameInt:%[^ \t]+]] = ptrtoint i8* [[framePtr]] to [[$intType:i[0-9]+]] -; CHECK: [[lowest:%[^ \t]+]] = load [[$intType]], [[$intType]]* @__sancov_lowest_stack -; CHECK: [[cmp:%[^ \t]+]] = icmp ult [[$intType]] [[frameInt]], [[lowest]] -; CHECK: br i1 [[cmp]], label %[[ifLabel:[^ \t]+]], label -; CHECK: <label>:[[ifLabel]]: -; CHECK: store [[$intType]] [[frameInt]], [[$intType]]* @__sancov_lowest_stack +; CHECK-NOT: call i8* @llvm.frameaddress(i32 0) +; CHECK-NOT: @__sancov_lowest_stack ; CHECK: ret i32 7 ret i32 7 @@ -30,12 +25,12 @@ define i32 @bar() { entry: ; CHECK-LABEL: define i32 @bar ; CHECK: [[framePtr:%[^ \t]+]] = call i8* @llvm.frameaddress(i32 0) -; CHECK: [[frameInt:%[^ \t]+]] = ptrtoint i8* [[framePtr]] to [[$intType]] -; CHECK: [[lowest:%[^ \t]+]] = load [[$intType]], [[$intType]]* @__sancov_lowest_stack -; CHECK: [[cmp:%[^ \t]+]] = icmp ult [[$intType]] [[frameInt]], [[lowest]] +; CHECK: [[frameInt:%[^ \t]+]] = ptrtoint i8* [[framePtr]] to [[intType:i[0-9]+]] +; CHECK: [[lowest:%[^ \t]+]] = load [[intType]], [[intType]]* @__sancov_lowest_stack +; CHECK: [[cmp:%[^ \t]+]] = icmp ult [[intType]] [[frameInt]], [[lowest]] ; CHECK: br i1 [[cmp]], label %[[ifLabel:[^ \t]+]], label ; CHECK: <label>:[[ifLabel]]: -; CHECK: store [[$intType]] [[frameInt]], [[$intType]]* @__sancov_lowest_stack +; CHECK: store [[intType]] [[frameInt]], [[intType]]* @__sancov_lowest_stack ; CHECK: %call = call i32 @foo() ; CHECK: ret i32 %call |

