1 // RUN: split-file %s %t
3 // RUN: %clang_pgogen -c shr1.c -o shr1.o -Xclang -fprofile-instrument-path=default_1.profraw
4 // RUN: %clang_pgogen -shared shr1.o -o shr1.so -mxcoff-build-id=0x01
6 // RUN: %clangxx_pgogen -c shr2.cpp -o shr2.o -Xclang -fprofile-instrument-path=default_2.profraw
7 // RUN: %clangxx_pgogen -shared shr2.o -o shr2.so -mxcoff-build-id=0x02
9 // RUN: %clang_pgogen -c main.c -o main.o -Xclang -fprofile-instrument-path=default_main.profraw
10 // RUN: %clang_pgogen main.o -L%t shr1.so shr2.so -o a.out -mxcoff-build-id=0xFFFFFFFFFFFFFFFF
14 // RUN: llvm-profdata show --binary-ids default_1.profraw | FileCheck %s --check-prefix=SHARED1
15 // RUN: llvm-profdata show --binary-ids default_2.profraw | FileCheck %s --check-prefix=SHARED2
16 // RUN: llvm-profdata show --binary-ids default_main.profraw | FileCheck %s --check-prefix=MAIN
18 // SHARED1: Binary IDs:
19 // SHARED1-NEXT: {{^}}01{{$}}
20 // SHARED2: Binary IDs:
21 // SHARED2-NEXT: {{^}}02{{$}}
23 // MAIN-NEXT: {{^}}ffffffffffffffff{{$}}
26 int shr1() { return 1; }
29 int helper() { return 3; }
30 extern "C" int shr2() { return helper(); }
35 int main() { return 4 - shr1() - shr2(); }