Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GCOV] Add a test for function defined on one line (follow-up of http…
…s://reviews.llvm.org/D53600) Summary: Add a test for coverage for function definition like void foo() { }. Reviewers: marco-c Reviewed By: marco-c Subscribers: delcypher, llvm-commits, #sanitizers, sylvestre.ledru Differential Revision: https://reviews.llvm.org/D53601 llvm-svn: 345625
- Loading branch information
1 parent
38d5054
commit 4b0c66d
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
compiler-rt/test/profile/Inputs/instrprof-gcov-one-line-function.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
void foo() { } | ||
|
||
void bar() { } | ||
|
||
int main(void) { | ||
foo(); | ||
|
||
bar(); | ||
|
||
return 0; | ||
} |
16 changes: 16 additions & 0 deletions
16
compiler-rt/test/profile/Inputs/instrprof-gcov-one-line-function.c.gcov
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// CHECK: -: 0:Source:/home/calixte/dev/mozilla/llvm.cal/projects/compiler-rt/test/profile/Inputs/instrprof-gcov-one-line-function.c | ||
// CHECK-NEXT: -: 0:Graph:instrprof-gcov-one-line-function.gcno | ||
// CHECK-NEXT: -: 0:Data:instrprof-gcov-one-line-function.gcda | ||
// CHECK-NEXT: -: 0:Runs:1 | ||
// CHECK-NEXT: -: 0:Programs:1 | ||
// CHECK-NEXT: 1: 1:void foo() { } | ||
// CHECK-NEXT: -: 2: | ||
// CHECK-NEXT: 1: 3:void bar() { } | ||
// CHECK-NEXT: -: 4: | ||
// CHECK-NEXT: 1: 5:int main(void) { | ||
// CHECK-NEXT: 1: 6: foo(); | ||
// CHECK-NEXT: -: 7: | ||
// CHECK-NEXT: 1: 8: bar(); | ||
// CHECK-NEXT: -: 9: | ||
// CHECK-NEXT: 1: 10: return 0; | ||
// CHECK-NEXT: -: 11:} |
9 changes: 9 additions & 0 deletions
9
compiler-rt/test/profile/instrprof-gcov-one-line-function.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
RUN: mkdir -p %t.d | ||
RUN: cd %t.d | ||
|
||
RUN: %clang --coverage -o %t %S/Inputs/instrprof-gcov-one-line-function.c | ||
RUN: test -f instrprof-gcov-one-line-function.gcno | ||
RUN: rm -f instrprof-gcov-one-line-function.gcda | ||
RUN: %run %t | ||
RUN: llvm-cov gcov instrprof-gcov-one-line-function.gcda | ||
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-gcov-one-line-function.c.gcov %S/Inputs/instrprof-gcov-one-line-function.c.gcov |