brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · 318a4ed Raw
43 lines · plain
1"""2This test produces two shared libraries:3 41. libt-instr.so is instrumented52. libt-no-instr.so is built with profile rt linked in (via -u<hook>), but the object file is built6   with instrumentation turned off.7 8The test verifies concatenating profiles with only headers and no profile data and counters.9"""10 11RUN: mkdir -p %t.d12RUN: %clang_profgen -o %t.d/libt-instr.so -fPIC -shared %S/../Inputs/instrprof-shared-lib.c13RUN: %clang -c -o %t.d/instrprof-shared-lib-no-instr.o -fPIC  %S/../Inputs/instrprof-shared-lib.c14RUN: %clang_profgen -o %t.d/libt-no-instr.so -fPIC -shared %t.d/instrprof-shared-lib-no-instr.o15 16# Header + Header17RUN: echo "src:other.c" > %t-file.list18RUN: %clang_profgen -fprofile-list=%t-file.list -o %t-no-instr-no-instr -L%t.d -rpath %t.d -lt-no-instr  %S/../Inputs/instrprof-shared-main.c19RUN: env LLVM_PROFILE_FILE=%t-no-instr-no-instr.profraw %run %t-no-instr-no-instr20RUN: llvm-profdata show %t-no-instr-no-instr.profraw | FileCheck %s --check-prefix=HEADER-HEADER21// HEADER-HEADER: Instrumentation level: Front-end22// HEADER-HEADER-NEXT: Total functions: 023// HEADER-HEADER-NEXT: Maximum function count: 024// HEADER-HEADER-NEXT: Maximum internal block count: 025 26# Header + Profile27RUN: %clang_profgen -fprofile-list=%t-file.list -o %t-no-instr-instr -L%t.d -rpath %t.d -lt-instr  %S/../Inputs/instrprof-shared-main.c28RUN: env LLVM_PROFILE_FILE=%t-no-instr-instr.profraw %run %t-no-instr-instr29RUN: llvm-profdata show %t-no-instr-instr.profraw | FileCheck %s --check-prefix=HEADER-PROFILE30// HEADER-PROFILE: Instrumentation level: Front-end31// HEADER-PROFILE-NEXT: Total functions: 132// HEADER-PROFILE-NEXT: Maximum function count: 100000033// HEADER-PROFILE-NEXT: Maximum internal block count: 36000034 35# Profile + Header36RUN: %clang_profgen -o %t-instr-no-instr -L%t.d -rpath %t.d -lt-no-instr %S/../Inputs/instrprof-shared-main.c37RUN: env LLVM_PROFILE_FILE=%t-instr-no-instr.profraw %run %t-instr-no-instr38RUN: llvm-profdata show %t-instr-no-instr.profraw | FileCheck %s --check-prefix=PROFILE-HEADER39// PROFILE-HEADER: Instrumentation level: Front-end40// PROFILE-HEADER-NEXT: Total functions: 141// PROFILE-HEADER-NEXT: Maximum function count: 142// PROFILE-HEADER-NEXT: Maximum internal block count: 100000043