2020-09-03 05:50:32 +08:00
|
|
|
// RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -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
|
|
|
|
2022-02-09 22:10:10 +08:00
|
|
|
void bar(void);
|
|
|
|
static void static_func(void);
|
2014-08-20 01:32:30 +08:00
|
|
|
|
|
|
|
// CHECK: main
|
2022-02-09 22:10:10 +08:00
|
|
|
int main(void) { // CHECK-NEXT: File 0, [[@LINE]]:16 -> [[@LINE+8]]:2 = #0
|
2020-12-29 01:20:48 +08:00
|
|
|
// CHECK-NEXT: File 0, [[@LINE+2]]:18 -> [[@LINE+2]]:24 = (#0 + #1)
|
|
|
|
// CHECK-NEXT: Branch,File 0, [[@LINE+1]]:18 -> [[@LINE+1]]:24 = #1, #0
|
2015-02-04 05:35:49 +08:00
|
|
|
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
|
2022-02-09 22:10:10 +08:00
|
|
|
void foo(void) { // CHECK-NEXT: File 0, [[@LINE]]:16 -> [[@LINE+5]]:2 = #0
|
2015-02-19 11:10:30 +08:00
|
|
|
// 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
|
2022-02-09 22:10:10 +08:00
|
|
|
void bar(void) { // CHECK-NEXT: File 0, [[@LINE]]:16 -> [[@LINE+1]]:2 = #0
|
2014-08-20 01:32:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-NEXT: static_func
|
2022-02-09 22:10:10 +08:00
|
|
|
void static_func(void) { } // CHECK: File 0, [[@LINE]]:24 -> [[@LINE]]:27 = #0
|
2014-08-20 01:32:30 +08:00
|
|
|
|
|
|
|
// CHECK-NEXT: func
|
2022-02-09 22:10:10 +08:00
|
|
|
static void func(void) { } // CHECK: File 0, [[@LINE]]:24 -> [[@LINE]]:27 = 0
|