1 // The waiting loop never exits via the normal
2 // path before the profile is dumped and the
3 // program is terminated. This tests checks
4 // that the entry of main is properly instrumented
5 // and has non-zero count.
7 // RUN: %clang_pgogen -mllvm -do-counter-promotion=false -O2 -o %t %s
8 // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
9 // RUN: llvm-profdata show -function main -counts %t.profraw| FileCheck %s
12 int __llvm_profile_dump(void);
13 void __llvm_profile_reset_counters(void);
16 __attribute__((noinline
)) void doSth() {
20 // dump profile and exit;
21 __llvm_profile_dump();
26 int noerror() { return (errorcode
== 0); }
28 int main(int argc
, const char *argv
[]) {