From 2ad650ea4f1ae333dfe7fadb71e44ea1010b7d91 Mon Sep 17 00:00:00 2001 From: Mike Aizatsky Date: Wed, 16 Dec 2015 00:31:48 +0000 Subject: [sancov] blacklist support. Summary: Using the blacklist the user can filter own unwanted functions from all outputs. By default blacklist contains "fun:__sancov*" line. Differential Revision: http://reviews.llvm.org/D15364 llvm-svn: 255732 --- llvm/test/tools/sancov/Inputs/blacklist.txt | 1 + llvm/test/tools/sancov/Inputs/test-linux_x86_64 | Bin 2331068 -> 2355767 bytes .../tools/sancov/Inputs/test-linux_x86_64-1.sancov | Bin 80 -> 80 bytes .../tools/sancov/Inputs/test-linux_x86_64.sancov | Bin 72 -> 64 bytes llvm/test/tools/sancov/Inputs/test.cpp | 2 +- llvm/test/tools/sancov/blacklist.test | 5 +++++ llvm/test/tools/sancov/not_covered_functions.test | 3 ++- llvm/test/tools/sancov/print.test | 16 ++++++++-------- 8 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 llvm/test/tools/sancov/Inputs/blacklist.txt create mode 100644 llvm/test/tools/sancov/blacklist.test (limited to 'llvm/test/tools') diff --git a/llvm/test/tools/sancov/Inputs/blacklist.txt b/llvm/test/tools/sancov/Inputs/blacklist.txt new file mode 100644 index 00000000000..b782960652b --- /dev/null +++ b/llvm/test/tools/sancov/Inputs/blacklist.txt @@ -0,0 +1 @@ +fun:bar* diff --git a/llvm/test/tools/sancov/Inputs/test-linux_x86_64 b/llvm/test/tools/sancov/Inputs/test-linux_x86_64 index 50060166ac3..2d141b693b2 100755 Binary files a/llvm/test/tools/sancov/Inputs/test-linux_x86_64 and b/llvm/test/tools/sancov/Inputs/test-linux_x86_64 differ diff --git a/llvm/test/tools/sancov/Inputs/test-linux_x86_64-1.sancov b/llvm/test/tools/sancov/Inputs/test-linux_x86_64-1.sancov index 08a0521277b..a1c7f7b6cc3 100644 Binary files a/llvm/test/tools/sancov/Inputs/test-linux_x86_64-1.sancov and b/llvm/test/tools/sancov/Inputs/test-linux_x86_64-1.sancov differ diff --git a/llvm/test/tools/sancov/Inputs/test-linux_x86_64.sancov b/llvm/test/tools/sancov/Inputs/test-linux_x86_64.sancov index f8030c33d6c..e5ed81ed906 100644 Binary files a/llvm/test/tools/sancov/Inputs/test-linux_x86_64.sancov and b/llvm/test/tools/sancov/Inputs/test-linux_x86_64.sancov differ diff --git a/llvm/test/tools/sancov/Inputs/test.cpp b/llvm/test/tools/sancov/Inputs/test.cpp index 795468b4bcb..5690409a278 100644 --- a/llvm/test/tools/sancov/Inputs/test.cpp +++ b/llvm/test/tools/sancov/Inputs/test.cpp @@ -1,5 +1,5 @@ // compile & generate coverage data using: -// clang++ -g -o test-linux_x86_64 -fsanitize=address -fsanitize-coverage=edge *.cpp +// clang++ -g -o test-linux_x86_64 -fsanitize=address -fsanitize-coverage=bb test.cpp foo.cpp // ASAN_OPTIONS="coverage=1" ./test-linux_x86_64 && mv test-linux_x86_64.*.sancov test-linux_x86_64.sancov // ASAN_OPTIONS="coverage=1" ./test-linux_x86_64 1 && mv test-linux_x86_64.*.sancov test-linux_x86_64-1.sancov diff --git a/llvm/test/tools/sancov/blacklist.test b/llvm/test/tools/sancov/blacklist.test new file mode 100644 index 00000000000..c07f5cdd109 --- /dev/null +++ b/llvm/test/tools/sancov/blacklist.test @@ -0,0 +1,5 @@ +REQUIRES: x86_64-linux +RUN: sancov -obj %p/Inputs/test-linux_x86_64 -covered-functions -blacklist %p/Inputs/blacklist.txt %p/Inputs/test-linux_x86_64.sancov | FileCheck %s + +CHECK-NOT: Inputs{{[/\\]}}test.cpp:12 bar(std::string) +CHECK: Inputs{{[/\\]}}test.cpp:14 main diff --git a/llvm/test/tools/sancov/not_covered_functions.test b/llvm/test/tools/sancov/not_covered_functions.test index b82f9e22d5d..8bcbac7f7b1 100644 --- a/llvm/test/tools/sancov/not_covered_functions.test +++ b/llvm/test/tools/sancov/not_covered_functions.test @@ -3,5 +3,6 @@ RUN: sancov -obj %p/Inputs/test-linux_x86_64 -not-covered-functions %p/Inputs/te RUN: sancov -obj %p/Inputs/test-linux_x86_64 -not-covered-functions %p/Inputs/test-linux_x86_64-1.sancov | FileCheck --check-prefix=CHECK1 --allow-empty %s CHECK: Inputs{{[/\\]}}foo.cpp:5 foo() -CHECK1-NOT: {{.}}* +CHECK-NOT: {{.*__sanitizer.*}} +CHECK1-NOT: {{.+}} diff --git a/llvm/test/tools/sancov/print.test b/llvm/test/tools/sancov/print.test index e6079ec3369..c67bbaa842a 100644 --- a/llvm/test/tools/sancov/print.test +++ b/llvm/test/tools/sancov/print.test @@ -1,11 +1,11 @@ REQUIRES: x86_64-linux RUN: sancov -obj %p/Inputs/test-linux_x86_64 -print %p/Inputs/test-linux_x86_64.sancov | FileCheck %s -CHECK: 0x4db18b -CHECK: 0x4db2d2 -CHECK: 0x4db322 -CHECK: 0x4db376 -CHECK: 0x4db3bd -CHECK: 0x4db3f4 -CHECK: 0x4db427 -CHECK: 0x4db45a +CHECK: 0x4dbe2b +CHECK: 0x4dbf72 +CHECK: 0x4dbfec +CHECK: 0x4dc033 +CHECK: 0x4dc06a +CHECK: 0x4dc09d +CHECK: 0x4dc0d0 + -- cgit v1.2.3