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