2016-02-05 02:39:09 +08:00
|
|
|
// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name test.c %s | FileCheck %s
|
2014-08-20 01:32:30 +08:00
|
|
|
|
|
|
|
void bar();
|
|
|
|
static void static_func();
|
|
|
|
|
|
|
|
// CHECK: main
|
2015-02-04 05:35:49 +08:00
|
|
|
int main() { // CHECK-NEXT: File 0, [[@LINE]]:12 -> [[@LINE+7]]:2 = #0
|
|
|
|
// CHECK-NEXT: File 0, [[@LINE+1]]:18 -> [[@LINE+1]]:24 = (#0 + #1)
|
|
|
|
for(int i = 0; i < 10; ++i) { // CHECK-NEXT: File 0, [[@LINE]]:26 -> [[@LINE]]:29 = #1
|
2017-11-30 06:25:14 +08:00
|
|
|
bar(); // CHECK: File 0, [[@LINE-1]]:31 -> [[@LINE+1]]:4 = #1
|
2014-08-20 01:32:30 +08:00
|
|
|
}
|
|
|
|
static_func();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-NEXT: foo
|
2015-02-19 11:10:30 +08:00
|
|
|
void foo() { // CHECK-NEXT: File 0, [[@LINE]]:12 -> [[@LINE+5]]:2 = #0
|
|
|
|
// CHECK-NEXT: File 0, [[@LINE+1]]:6 -> [[@LINE+1]]:7 = #0
|
2017-11-09 10:33:38 +08:00
|
|
|
if(1) { // CHECK: File 0, [[@LINE]]:9 -> [[@LINE+2]]:4 = #1
|
2014-08-20 01:32:30 +08:00
|
|
|
int i = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-NEXT: bar
|
2015-02-04 05:35:49 +08:00
|
|
|
void bar() { // CHECK-NEXT: File 0, [[@LINE]]:12 -> [[@LINE+1]]:2 = #0
|
2014-08-20 01:32:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-NEXT: static_func
|
2015-02-04 05:35:49 +08:00
|
|
|
void static_func() { } // CHECK: File 0, [[@LINE]]:20 -> [[@LINE]]:23 = #0
|
2014-08-20 01:32:30 +08:00
|
|
|
|
|
|
|
// CHECK-NEXT: func
|
2015-02-04 05:35:49 +08:00
|
|
|
static void func() { } // CHECK: File 0, [[@LINE]]:20 -> [[@LINE]]:23 = 0
|