1// REQUIRES: darwin
2
3// RUN: echo "void dso1(void) {}" > %t.dso1.c
4// RUN: echo "void dso2(void) {}" > %t.dso2.c
5// RUN: %clang_pgogen -dynamiclib -o %t.dso1.dylib %t.dso1.c
6// RUN: %clang_pgogen -dynamiclib -o %t.dso2.dylib %t.dso2.c
7// RUN: %clang_pgogen -o %t.exe %s %t.dso1.dylib %t.dso2.dylib
8// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe 2>&1 | count 0
9// RUN: llvm-profdata show --counts --all-functions %t.profraw | FileCheck %s
10
11// CHECK-LABEL: Counters:
12// CHECK-NEXT: dso1:
13// CHECK-NEXT: Hash: 0x{{.*}}
14// CHECK-NEXT: Counters: 1
15// CHECK-NEXT: Block counts: [1]
16// CHECK-NEXT: dso2:
17// CHECK-NEXT: Hash: 0x{{.*}}
18// CHECK-NEXT: Counters: 1
19// CHECK-NEXT: Block counts: [1]
20// CHECK-NEXT: main:
21// CHECK-NEXT: Hash: 0x{{.*}}
22// CHECK-NEXT: Counters: 1
23// CHECK-NEXT: Block counts: [1]
24// CHECK-NEXT: Instrumentation level: IR
25// CHECK-NEXT: Functions shown: 3
26// CHECK-NEXT: Total functions: 3
27// CHECK-NEXT: Maximum function count: 1
28// CHECK-NEXT: Maximum internal block count: 0
29
30void dso1(void);
31void dso2(void);
32
33int main() {
34 dso1();
35 dso2();
36 return 0;
37}
38

source code of compiler-rt/test/profile/ContinuousSyncMode/multiple-DSOs.c