blob: c268191d2237273ea0cd8cac515e502c92675ede [file] [log] [blame]
Alex Lorenz34ac9b52014-08-19 17:32:30 +00001// RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name tu1.cpp %s > %tmapping
Alex Lorenze3b04a92014-08-20 17:29:47 +00002// RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-FUNC
3// RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-STATIC-FUNC
4// RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-STATIC-FUNC2
Alex Lorenz34ac9b52014-08-19 17:32:30 +00005
6#include "Inputs/header1.h"
7
8int main() {
9 func(1);
10 static_func(2);
11}
12
13// CHECK-FUNC: func
14// CHECK-FUNC: File 0, 4:25 -> 11:2 = #0 (HasCodeBefore = 0)
15// CHECK-FUNC: File 0, 6:15 -> 8:4 = #1 (HasCodeBefore = 0)
16// CHECK-FUNC: File 0, 8:10 -> 10:4 = (#0 - #1) (HasCodeBefore = 0)
Alex Lorenzb5f3a842014-08-19 20:51:54 +000017// CHECK-FUNC: Expansion,File 1, 6:10 -> 6:28 = #0 (HasCodeBefore = 0, Expanded file = 0)
Alex Lorenz34ac9b52014-08-19 17:32:30 +000018
19// CHECK-STATIC-FUNC: static_func
20// CHECK-STATIC-FUNC: File 0, 12:32 -> 20:2 = #0 (HasCodeBefore = 0)
21// CHECK-STATIC-FUNC: File 0, 14:15 -> 16:4 = #1 (HasCodeBefore = 0)
Alex Lorenzb5f3a842014-08-19 20:51:54 +000022// CHECK-STATIC-FUNC: File 0, 16:10 -> 18:4 = (#0 - #1) (HasCodeBefore = 0)
23// CHECK-STATIC-FUNC: Expansion,File 1, 6:10 -> 6:28 = #0 (HasCodeBefore = 0, Expanded file = 0)
Alex Lorenz34ac9b52014-08-19 17:32:30 +000024
25// CHECK-STATIC-FUNC2: static_func2
26// CHECK-STATIC-FUNC2: File 0, 21:33 -> 29:2 = 0 (HasCodeBefore = 0)
Alex Lorenzb5f3a842014-08-19 20:51:54 +000027// CHECK-STATIC-FUNC2: Expansion,File 1, 6:10 -> 6:28 = 0 (HasCodeBefore = 0, Expanded file = 0)