summaryrefslogtreecommitdiffstats
path: root/clang/test/CoverageMapping/header.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CoverageMapping/header.cpp')
-rw-r--r--clang/test/CoverageMapping/header.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/CoverageMapping/header.cpp b/clang/test/CoverageMapping/header.cpp
new file mode 100644
index 00000000000..9e4ab54ebde
--- /dev/null
+++ b/clang/test/CoverageMapping/header.cpp
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name tu1.cpp %s > %tmapping
+// cat %tmapping | FileCheck %s --check-prefix=CHECK-FUNC
+// cat %tmapping | FileCheck %s --check-prefix=CHECK-STATIC-FUNC
+// cat %tmapping | FileCheck %s --check-prefix=CHECK-STATIC-FUNC2
+
+#include "Inputs/header1.h"
+
+int main() {
+ func(1);
+ static_func(2);
+}
+
+// CHECK-FUNC: func
+// CHECK-FUNC: File 0, 4:25 -> 11:2 = #0 (HasCodeBefore = 0)
+// CHECK-FUNC: File 0, 6:15 -> 8:4 = #1 (HasCodeBefore = 0)
+// CHECK-FUNC: File 0, 8:10 -> 10:4 = (#0 - #1) (HasCodeBefore = 0)
+// CHECK-FUNC: Expansion,File 1, 3:10 -> 3:28 = #0 (HasCodeBefore = 0, Expanded file = 0)
+
+// CHECK-STATIC-FUNC: static_func
+// CHECK-STATIC-FUNC: File 0, 12:32 -> 20:2 = #0 (HasCodeBefore = 0)
+// CHECK-STATIC-FUNC: File 0, 14:15 -> 16:4 = #1 (HasCodeBefore = 0)
+// CHECK-STATIC-FUNC File 0, 16:10 -> 18:4 = (#0 - #1) (HasCodeBefore = 0)
+// CHECK-STATIC-FUNC: Expansion,File 1, 3:10 -> 3:28 = #0 (HasCodeBefore = 0, Expanded file = 0)
+
+// CHECK-STATIC-FUNC2: static_func2
+// CHECK-STATIC-FUNC2: File 0, 21:33 -> 29:2 = 0 (HasCodeBefore = 0)
+// CHECK-STATIC-FUNC2: Expansion,File 1, 3:10 -> 3:28 = 0 (HasCodeBefore = 0, Expanded file = 0)
OpenPOWER on IntegriCloud