Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / profile / infinite_loop.c
blob0e3981c712f6b12a92c6954e8ba7f80b41297eb2
1 // RUN: %clang_pgogen -O2 -o %t %s
2 // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
3 // RUN: llvm-profdata show -function main -counts %t.profraw| FileCheck %s
5 void exit(int);
6 int g;
7 __attribute__((noinline)) void foo()
9 g++;
10 if (g==1000)
11 exit(0);
15 int main()
17 while (1) {
18 foo();
23 // CHECK: Counters:
24 // CHECK-NEXT: main:
25 // CHECK-NEXT: Hash: {{.*}}
26 // CHECK-NEXT: Counters: 2
27 // CHECK-NEXT: Block counts: [1000, 1]