Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / tools / llvm-cov / gcov / gcov-12.c
blob5e754f5b9cccb8a6379e465e9be81ca38bec20db
1 /// Test that llvm-cov supports gcov 12 compatible format.
2 #include <math.h>
3 #include <stdio.h>
4 int main() { // GCOV: 1: [[@LINE]]:int main
5 double a[11], result; // GCOV-NEXT: -: [[@LINE]]:
6 for (int i = 0; i < 11; i++) // GCOV-NEXT: 12: [[@LINE]]:
7 scanf("%lf", &a[i]); // GCOV-NEXT: 11: [[@LINE]]:
8 for (int i = 10; i >= 0; i--) { // GCOV-NEXT: 12: [[@LINE]]:
9 result = sqrt(fabs(a[i])) + 5 * pow(a[i], 3); // GCOV-NEXT: 11: [[@LINE]]:
10 printf("\nf(%d) = ", i); // GCOV-NEXT: 11: [[@LINE]]:
11 if (result > 400) printf("Overflow!"); // GCOV-NEXT: 11: [[@LINE]]:
12 else printf("%lf", result); // GCOV-NEXT: 4: [[@LINE]]:
13 } // GCOV-NEXT: -: [[@LINE]]:
14 return 0; // GCOV-NEXT: 1: [[@LINE]]:
15 } // GCOV-NEXT: -: [[@LINE]]:
17 // RUN: rm -rf %t && mkdir %t && cd %t
18 // RUN: cp %s %p/Inputs/gcov-12.gc* .
20 // RUN: llvm-cov gcov gcov-12.c | FileCheck %s
21 // CHECK: File 'gcov-12.c'
22 // CHECK-NEXT: Lines executed:100.00% of 9
23 // CHECK-NEXT: Creating 'gcov-12.c.gcov'
25 // RUN: FileCheck --input-file=%t/gcov-12.c.gcov --check-prefix=HEADER %s
26 // RUN: FileCheck --input-file=%t/gcov-12.c.gcov --check-prefix=GCOV %s
28 // HEADER: {{^}} -: 0:Source:gcov-12.c
29 // HEADER-NEXT: -: 0:Graph:gcov-12.gcno
30 // HEADER-NEXT: -: 0:Data:gcov-12.gcda
31 // HEADER-NEXT: -: 0:Runs:1{{$}}
32 // HEADER-NEXT: -: 1:/// Test that llvm-cov