| 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 |
| 6 | |
| 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 |
| 13 | |
| 14 | void foo() {} |
| 15 | |
| 16 | void bar() {} |
| 17 | |
| 18 | int main() { |
| 19 | foo(); |
| 20 | bar(); |
| 21 | return 0; |
| 22 | } |
| 23 | |
| 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: Total number of blocks: 3 |
| 29 | // RAW-PROF-NEXT: Total count: 3 |
| 30 | // RAW-PROF-NEXT: Profile version: {{[0-9]+}} |
| 31 | |
| 32 | // INDEXED-PROF: Instrumentation level: Front-end |
| 33 | // INDEXED-PROF-NEXT: Total functions: 3 |
| 34 | // INDEXED-PROF-NEXT: Maximum function count: 3 |
| 35 | // INDEXED-PROF-NEXT: Maximum internal block count: 0 |
| 36 | // INDEXED-PROF-NEXT: Total number of blocks: 3 |
| 37 | // INDEXED-PROF-NEXT: Total count: 9 |
| 38 | // INDEXED-PROF-NEXT: Profile version: {{[0-9]+}} |
| 39 | |