Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / profile / AIX / binary-id-shared.c
blob55ba9d85c5ee11c9f75e5183612b8d3ba5a2d6cf
1 // RUN: split-file %s %t
2 // RUN: cd %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
5 //
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
8 //
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
12 // RUN: %run ./a.out
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{{$}}
22 // MAIN: Binary IDs:
23 // MAIN-NEXT: {{^}}ffffffffffffffff{{$}}
25 //--- shr1.c
26 int shr1() { return 1; }
28 //--- shr2.cpp
29 int helper() { return 3; }
30 extern "C" int shr2() { return helper(); }
32 //--- main.c
33 int shr1();
34 int shr2();
35 int main() { return 4 - shr1() - shr2(); }