Skip to content

Commit

Permalink
sancov -not-covered-functions.
Browse files Browse the repository at this point in the history
Summary: The command prints out list of functions that were not entered.
To do this, addresses are first converted to function locations. Set
operations are used for function locations.

Differential Revision: http://reviews.llvm.org/D14889

review

llvm-svn: 254742
  • Loading branch information
aizatsky-chromium committed Dec 4, 2015
1 parent 1ce2b1a commit 0650e9b
Show file tree
Hide file tree
Showing 4 changed files with 317 additions and 94 deletions.
11 changes: 5 additions & 6 deletions llvm/test/tools/sancov/covered_functions.test
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
REQUIRES: x86_64-linux
RUN: sancov -obj %p/Inputs/test-linux_x86_64 -covered_functions %p/Inputs/test-linux_x86_64.sancov | FileCheck %s
RUN: sancov -obj %p/Inputs/test-linux_x86_64 -covered_functions %p/Inputs/test-linux_x86_64-1.sancov | FileCheck --check-prefix=MULTIPLE_FILES %s
RUN: sancov -obj %p/Inputs/test-linux_x86_64 -demangle=0 -covered_functions %p/Inputs/test-linux_x86_64.sancov | FileCheck --check-prefix=NO_DEMANGLE %s
RUN: sancov -obj %p/Inputs/test-linux_x86_64 -covered-functions %p/Inputs/test-linux_x86_64.sancov | FileCheck %s
RUN: sancov -obj %p/Inputs/test-linux_x86_64 -covered-functions -strip_path_prefix=Inputs/ %p/Inputs/test-linux_x86_64.sancov | FileCheck --check-prefix=STRIP_PATH %s
RUN: sancov -obj %p/Inputs/test-linux_x86_64 -demangle=0 -covered-functions %p/Inputs/test-linux_x86_64.sancov | FileCheck --check-prefix=NO_DEMANGLE %s

CHECK: Inputs{{[/\\]}}test.cpp:12 bar(std::string)
CHECK: Inputs{{[/\\]}}test.cpp:14 main

MULTIPLE_FILES: {{^}}foo.cpp:5 foo()
MULTIPLE_FILES: {{^}}test.cpp:12 bar(std::string)
MULTIPLE_FILES: {{^}}test.cpp:14 main
STRIP_PATH: {{^}}test.cpp:12 bar(std::string)
STRIP_PATH: {{^}}test.cpp:14 main

NO_DEMANGLE: test.cpp:12 _Z3barSs
NO_DEMANGLE: test.cpp:14 main
7 changes: 7 additions & 0 deletions llvm/test/tools/sancov/not_covered_functions.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
REQUIRES: x86_64-linux
RUN: sancov -obj %p/Inputs/test-linux_x86_64 -not-covered-functions %p/Inputs/test-linux_x86_64.sancov | FileCheck %s
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: {{.}}*

4 changes: 4 additions & 0 deletions llvm/tools/sancov/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
set(LLVM_LINK_COMPONENTS
AllTargetsAsmPrinters
AllTargetsDescs
AllTargetsDisassemblers
AllTargetsInfos
DebugInfoDWARF
DebugInfoPDB
Object
Expand Down
Loading

0 comments on commit 0650e9b

Please sign in to comment.