diff --git a/compiler-rt/test/profile/Linux/binary-id.c b/compiler-rt/test/profile/Linux/binary-id.c --- a/compiler-rt/test/profile/Linux/binary-id.c +++ b/compiler-rt/test/profile/Linux/binary-id.c @@ -1,22 +1,27 @@ // REQUIRES: linux // RUN: %clang_profgen -Wl,--build-id=none -O2 -o %t %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t -// RUN: llvm-profdata show --binary-ids %t.profraw > %t.out -// RUN: FileCheck %s --check-prefix=NO-BINARY-ID < %t.out +// RUN: llvm-profdata show --binary-ids %t.profraw > %t.profraw.out +// RUN: FileCheck %s --check-prefix=NO-BINARY-ID < %t.profraw.out // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: %clang_profgen -Wl,--build-id -O2 -o %t %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t -// RUN: llvm-profdata show --binary-ids %t.profraw > %t.profraw.out +// RUN: llvm-profdata show --binary-ids %t.profraw > %t.profraw.out // RUN: FileCheck %s --check-prefix=BINARY-ID-RAW-PROF < %t.profraw.out // RUN: rm -rf %t.profdir // RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t // RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t // RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t -// RUN: llvm-profdata show --binary-ids %t.profdir/default_*.profraw > %t.profraw.out +// RUN: llvm-profdata show -all-functions --binary-ids %t.profdir/default_*.profraw > %t.profraw.out // RUN: FileCheck %s --check-prefix=BINARY-ID-MERGE-PROF < %t.profraw.out +// RUN: %clang_profgen -Wl,--build-id -O2 -mllvm -runtime-counter-relocation=true -o %t %s +// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t +// RUN: llvm-profdata show -all-functions --binary-ids %t.profraw > %t.profraw.out +// RUN: FileCheck %s --check-prefix=BINARY-ID-COUNTER-RELOC < %t.profraw.out + void foo() { } @@ -42,9 +47,44 @@ // BINARY-ID-RAW-PROF-NEXT: Binary IDs: // BINARY-ID-RAW-PROF-NEXT: {{[0-9a-f]+}} +// BINARY-ID-MERGE-PROF: Counters +// BINARY-ID-MERGE-PROF-NEXT: {{.*}}foo{{.*}}: +// BINARY-ID-MERGE-PROF-NEXT: Hash: +// BINARY-ID-MERGE-PROF-NEXT: Counters: 1 +// BINARY-ID-MERGE-PROF-NEXT: Function count: 3 +// BINARY-ID-MERGE-PROF: {{.*}}bar{{.*}}: +// BINARY-ID-MERGE-PROF-NEXT: Hash: +// BINARY-ID-MERGE-PROF-NEXT: Counters: 1 +// BINARY-ID-MERGE-PROF-NEXT: Function count: 3 +// BINARY-ID-MERGE-PROF: main: +// BINARY-ID-MERGE-PROF-NEXT: Hash: +// BINARY-ID-MERGE-PROF-NEXT: Counters: 1 +// BINARY-ID-MERGE-PROF-NEXT: Function count: 3 // BINARY-ID-MERGE-PROF: Instrumentation level: Front-end +// BINARY-ID-MERGE-PROF-NEXT: Functions shown: 3 // BINARY-ID-MERGE-PROF-NEXT: Total functions: 3 // BINARY-ID-MERGE-PROF-NEXT: Maximum function count: 3 // BINARY-ID-MERGE-PROF-NEXT: Maximum internal block count: 0 // BINARY-ID-MERGE-PROF-NEXT: Binary IDs: // BINARY-ID-MERGE-PROF-NEXT: {{[0-9a-f]+}} + +// BINARY-ID-COUNTER-RELOC: Counters +// BINARY-ID-COUNTER-RELOC-NEXT: {{.*}}foo{{.*}}: +// BINARY-ID-COUNTER-RELOC-NEXT: Hash: +// BINARY-ID-COUNTER-RELOC-NEXT: Counters: 1 +// BINARY-ID-COUNTER-RELOC-NEXT: Function count: 1 +// BINARY-ID-COUNTER-RELOC: {{.*}}bar{{.*}}: +// BINARY-ID-COUNTER-RELOC-NEXT: Hash: +// BINARY-ID-COUNTER-RELOC-NEXT: Counters: 1 +// BINARY-ID-COUNTER-RELOC-NEXT: Function count: 1 +// BINARY-ID-COUNTER-RELOC: main: +// BINARY-ID-COUNTER-RELOC-NEXT: Hash: +// BINARY-ID-COUNTER-RELOC-NEXT: Counters: 1 +// BINARY-ID-COUNTER-RELOC-NEXT: Function count: 1 +// BINARY-ID-COUNTER-RELOC: Instrumentation level: Front-end +// BINARY-ID-COUNTER-RELOC-NEXT: Functions shown: 3 +// BINARY-ID-COUNTER-RELOC-NEXT: Total functions: 3 +// BINARY-ID-COUNTER-RELOC-NEXT: Maximum function count: 1 +// BINARY-ID-COUNTER-RELOC-NEXT: Maximum internal block count: 0 +// BINARY-ID-COUNTER-RELOC-NEXT: Binary IDs: +// BINARY-ID-COUNTER-RELOC-NEXT: {{[0-9a-f]+}}