summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-cov
diff options
context:
space:
mode:
authorIgor Kudrin <ikudrin.dev@gmail.com>2016-05-05 09:39:45 +0000
committerIgor Kudrin <ikudrin.dev@gmail.com>2016-05-05 09:39:45 +0000
commit27d8dd39cf3c1fde9ce24bf7a5e8a36ce232582b (patch)
treee895dfc22976db0f728b7db8e9006335c0300bd9 /llvm/test/tools/llvm-cov
parentbb06ffaff39b9d0a1f008b5fa49438b1641e500c (diff)
downloadbcm5719-llvm-27d8dd39cf3c1fde9ce24bf7a5e8a36ce232582b.tar.gz
bcm5719-llvm-27d8dd39cf3c1fde9ce24bf7a5e8a36ce232582b.zip
[Coverage] Combine counts of expansion regions if there are no code regions for the same area.
Differential Revision: http://reviews.llvm.org/D18831 llvm-svn: 268620
Diffstat (limited to 'llvm/test/tools/llvm-cov')
-rw-r--r--llvm/test/tools/llvm-cov/Inputs/combine_expansions.covmappingbin0 -> 161 bytes
-rw-r--r--llvm/test/tools/llvm-cov/Inputs/combine_expansions.proftext8
-rw-r--r--llvm/test/tools/llvm-cov/combine_expansions.cpp26
3 files changed, 34 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-cov/Inputs/combine_expansions.covmapping b/llvm/test/tools/llvm-cov/Inputs/combine_expansions.covmapping
new file mode 100644
index 00000000000..3acc1cd90a9
--- /dev/null
+++ b/llvm/test/tools/llvm-cov/Inputs/combine_expansions.covmapping
Binary files differ
diff --git a/llvm/test/tools/llvm-cov/Inputs/combine_expansions.proftext b/llvm/test/tools/llvm-cov/Inputs/combine_expansions.proftext
new file mode 100644
index 00000000000..5419d233fc0
--- /dev/null
+++ b/llvm/test/tools/llvm-cov/Inputs/combine_expansions.proftext
@@ -0,0 +1,8 @@
+main
+# Func Hash:
+0
+# Num Counters:
+1
+# Counter Values:
+1
+
diff --git a/llvm/test/tools/llvm-cov/combine_expansions.cpp b/llvm/test/tools/llvm-cov/combine_expansions.cpp
new file mode 100644
index 00000000000..7017f295769
--- /dev/null
+++ b/llvm/test/tools/llvm-cov/combine_expansions.cpp
@@ -0,0 +1,26 @@
+// Check that we combine expansion regions.
+
+// RUN: llvm-profdata merge %S/Inputs/combine_expansions.proftext -o %t.profdata
+// RUN: llvm-cov show %S/Inputs/combine_expansions.covmapping -instr-profile %t.profdata -filename-equivalence %s | FileCheck %s
+
+#define SIMPLE_OP \
+ ++x
+// CHECK: | [[@LINE-2]]|#define SIMPLE_OP
+// CHECK-NEXT: 2| [[@LINE-2]]| ++x
+
+#define DO_SOMETHING \
+ { \
+ int x = 0; \
+ SIMPLE_OP; \
+ }
+// CHECK: | [[@LINE-5]]|#define DO_SOMETHING
+// CHECK-NEXT: 2| [[@LINE-5]]| {
+// CHECK-NEXT: 2| [[@LINE-5]]| int x = 0;
+// CHECK-NEXT: 2| [[@LINE-5]]| SIMPLE_OP;
+// CHECK-NEXT: 2| [[@LINE-5]]| }
+
+int main() { // CHECK: 1| [[@LINE]]|int main() {
+ DO_SOMETHING; // CHECK-NEXT: 1| [[@LINE]]| DO_SOMETHING;
+ DO_SOMETHING; // CHECK-NEXT: 1| [[@LINE]]| DO_SOMETHING;
+ return 0; // CHECK-NEXT: 1| [[@LINE]]| return 0;
+} // CHECK-NEXT: 1| [[@LINE]]|}
OpenPOWER on IntegriCloud