summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/tools')
-rw-r--r--llvm/test/tools/llvm-cov/Inputs/showProjectSummary.covmappingbin0 -> 144 bytes
-rw-r--r--llvm/test/tools/llvm-cov/Inputs/showProjectSummary.proftext10
-rw-r--r--llvm/test/tools/llvm-cov/showProjectSummary.cpp46
-rw-r--r--llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp8
4 files changed, 60 insertions, 4 deletions
diff --git a/llvm/test/tools/llvm-cov/Inputs/showProjectSummary.covmapping b/llvm/test/tools/llvm-cov/Inputs/showProjectSummary.covmapping
new file mode 100644
index 00000000000..d95caf27f2b
--- /dev/null
+++ b/llvm/test/tools/llvm-cov/Inputs/showProjectSummary.covmapping
Binary files differ
diff --git a/llvm/test/tools/llvm-cov/Inputs/showProjectSummary.proftext b/llvm/test/tools/llvm-cov/Inputs/showProjectSummary.proftext
new file mode 100644
index 00000000000..b3cdcc72565
--- /dev/null
+++ b/llvm/test/tools/llvm-cov/Inputs/showProjectSummary.proftext
@@ -0,0 +1,10 @@
+main
+# Func Hash:
+266
+# Num Counters:
+3
+# Counter Values:
+1
+20
+0
+
diff --git a/llvm/test/tools/llvm-cov/showProjectSummary.cpp b/llvm/test/tools/llvm-cov/showProjectSummary.cpp
new file mode 100644
index 00000000000..bfe4c0d19c7
--- /dev/null
+++ b/llvm/test/tools/llvm-cov/showProjectSummary.cpp
@@ -0,0 +1,46 @@
+// RUN: llvm-profdata merge -o %t.profdata %S/Inputs/showProjectSummary.proftext
+
+int main(int argc, char ** argv) {
+ int x=0;
+ for (int i = 0; i < 20; ++i)
+ x *= 2;
+ if (x >= 100)
+ x = x / 2;
+ else
+ x = x * 2;
+ return x;
+}
+
+// Test console output.
+// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile %t.profdata -filename-equivalence %s | FileCheck -check-prefixes=TEXT,TEXT-FILE,TEXT-HEADER %s
+// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile %t.profdata -project-title "Test Suite" -filename-equivalence %s | FileCheck -check-prefixes=TEXT-TITLE,TEXT,TEXT-FILE,TEXT-HEADER %s
+// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -instr-profile %t.profdata -project-title "Test Suite" -name=main -filename-equivalence %s | FileCheck -check-prefixes=TEXT-FUNCTION,TEXT-HEADER %s
+// TEXT-TITLE: Test Suite
+// TEXT: Code Coverage Report
+// TEXT: Created:
+// TEXT-FILE: showProjectSummary.cpp:
+// TEXT-FILE: showProjectSummary.covmapping:
+// TEXT-FUNCTION: main:
+
+// Test html output.
+// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -format=html -o %t.dir -instr-profile %t.profdata -filename-equivalence %s
+// RUN: FileCheck -check-prefixes=HTML,HTML-FILE,HTML-HEADER -input-file %t.dir/coverage/tmp/showProjectSummary.cpp.html %s
+// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -format=html -o %t.dir -instr-profile %t.profdata -project-title "Test Suite" -filename-equivalence %s
+// RUN: FileCheck -check-prefixes=HTML-TITLE,HTML,HTML-FILE,HTML-HEADER -input-file %t.dir/coverage/tmp/showProjectSummary.cpp.html %s
+// RUN: FileCheck -check-prefixes=HTML-TITLE,HTML -input-file %t.dir/index.html %s
+// RUN: llvm-cov show %S/Inputs/showProjectSummary.covmapping -format=html -o %t.dir -instr-profile %t.profdata -project-title "Test Suite" -filename-equivalence -name=main %s
+// RUN: FileCheck -check-prefixes=HTML-FUNCTION,HTML-HEADER -input-file %t.dir/functions.html %s
+// HTML-TITLE: <div class='project-title'>
+// HTML-TITLE: <span>Test Suite</span>
+// HTML: <div class='report-title'>
+// HTML: <span>Code Coverage Report</span>
+// HTML: <div class='created-time'>
+// HTML: <span>Created:
+// HTML-FILE: <pre>Source:
+// HTML-FILE: showProjectSummary.cpp</pre>
+// HTML-FILE: <pre>Binary:
+// HTML-FILE: showProjectSummary.covmapping</pre>
+// HTML-FUNCTION: <pre>Function: main</pre>
+// HTML-HEADER: <tr><td><span><pre>Line No.</pre></span></td>
+// HTML-HEADER: <td><span><pre>Count No.</pre></span></td>
+// HTML-HEADER: <td><span><pre>Source</pre></span></td>
diff --git a/llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp b/llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp
index 198ebd3b199..5a656db9809 100644
--- a/llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp
+++ b/llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp
@@ -13,7 +13,7 @@ int func(T x) { // ALL-NEXT: [[@LINE]]| 2|int func(T x) {
} // ALL-NEXT: [[@LINE]]| 2|}
// SHARED: {{^ *(\| )?}}_Z4funcIbEiT_:
- // SHARED-NEXT: [[@LINE-9]]| 1|int func(T x) {
+ // SHARED: [[@LINE-9]]| 1|int func(T x) {
// SHARED-NEXT: [[@LINE-9]]| 1| if(x)
// SHARED-NEXT: [[@LINE-9]]| 1| return 0;
// SHARED-NEXT: [[@LINE-9]]| 1| else
@@ -23,7 +23,7 @@ int func(T x) { // ALL-NEXT: [[@LINE]]| 2|int func(T x) {
// ALL: {{^ *}}| _Z4funcIiEiT_:
// FILTER-NOT: {{^ *(\| )?}} _Z4funcIiEiT_:
- // ALL-NEXT: [[@LINE-19]]| 1|int func(T x) {
+ // ALL: [[@LINE-19]]| 1|int func(T x) {
// ALL-NEXT: [[@LINE-19]]| 1| if(x)
// ALL-NEXT: [[@LINE-19]]| 0| return 0;
// ALL-NEXT: [[@LINE-19]]| 1| else
@@ -56,7 +56,7 @@ int main() { // ALL: [[@LINE]]| 1|int main() {
// HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='uncovered-line'><pre>0</pre></td><td class='code'><pre>
// HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>2</pre></td><td class='code'><pre>}
-// HTML-SHARED: <div class='source-name-title'><pre>_Z4funcIbEiT_</pre></div><table>
+// HTML-SHARED: <div class='source-name-title'><pre>Function: _Z4funcIbEiT_</pre></div>
// HTML-SHARED: <td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre>int func(T x) {
// HTML-SHARED: <td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre> if(x)
// HTML-SHARED: <td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre> ret
@@ -65,7 +65,7 @@ int main() { // ALL: [[@LINE]]| 1|int main() {
// HTML-SHARED: <td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='uncovered-line'><pre>0</pre></td><td class='code'><pre>
// HTML-SHARED: <td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre>}
-// HTML-ALL: <div class='source-name-title'><pre>_Z4funcIiEiT_</pre></div><table>
+// HTML-ALL: <div class='source-name-title'><pre>Function: _Z4funcIiEiT_</pre></div>
// HTML-FILTER-NOT: <div class='source-name-title'><pre>_Z4funcIiEiT_</pre></div><table>
// HTML-ALL: <td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre>int func(T x) {
// HTML-ALL: <td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre> if(x)
OpenPOWER on IntegriCloud