Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / profile / Linux / profile-version.c
blobbffc602387ad50f2dfb255882b68d349c21428a2
1 // REQUIRES: linux
2 // RUN: %clang_profgen -O2 -o %t %s
3 // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
4 // RUN: llvm-profdata show --profile-version %t.profraw > %t.profraw.out
5 // RUN: FileCheck %s --check-prefix=RAW-PROF < %t.profraw.out
7 // RUN: rm -rf %t.profdir
8 // RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t
9 // RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t
10 // RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t
11 // RUN: llvm-profdata show --profile-version %t.profdir/default_*.profraw > %t.profraw.out
12 // RUN: FileCheck %s --check-prefix=INDEXED-PROF < %t.profraw.out
14 void foo() {}
16 void bar() {}
18 int main() {
19 foo();
20 bar();
21 return 0;
24 // RAW-PROF: Instrumentation level: Front-end
25 // RAW-PROF-NEXT: Total functions: 3
26 // RAW-PROF-NEXT: Maximum function count: 1
27 // RAW-PROF-NEXT: Maximum internal block count: 0
28 // RAW-PROF-NEXT: Profile version: {{[0-9]+}}
30 // INDEXED-PROF: Instrumentation level: Front-end
31 // INDEXED-PROF-NEXT: Total functions: 3
32 // INDEXED-PROF-NEXT: Maximum function count: 3
33 // INDEXED-PROF-NEXT: Maximum internal block count: 0
34 // INDEXED-PROF-NEXT: Profile version: {{[0-9]+}}