xref: /aosp_15_r20/external/compiler-rt/test/profile/instrprof-dynamic-one-shared.test (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger RobotRUN: mkdir -p %t.d
2*7c3d14c8STreehugger RobotRUN: %clang_profgen -o %t.d/a.shared -fPIC -shared %S/Inputs/instrprof-dynamic-a.cpp
3*7c3d14c8STreehugger RobotRUN: %clang_profgen -o %t-shared -fPIC -rpath %t.d %t.d/a.shared %S/Inputs/instrprof-dynamic-b.cpp %S/Inputs/instrprof-dynamic-main.cpp
4*7c3d14c8STreehugger Robot
5*7c3d14c8STreehugger RobotRUN: %clang_profgen -o %t-static %S/Inputs/instrprof-dynamic-a.cpp %S/Inputs/instrprof-dynamic-b.cpp %S/Inputs/instrprof-dynamic-main.cpp
6*7c3d14c8STreehugger Robot
7*7c3d14c8STreehugger RobotRUN: env LLVM_PROFILE_FILE=%t-static.profraw %run %t-static
8*7c3d14c8STreehugger RobotRUN: env LLVM_PROFILE_FILE=%t-shared.profraw %run %t-shared
9*7c3d14c8STreehugger Robot
10*7c3d14c8STreehugger RobotRUN: llvm-profdata merge -o %t-static.profdata %t-static.profraw
11*7c3d14c8STreehugger RobotRUN: llvm-profdata merge -o %t-shared.profdata %t-shared.profraw
12*7c3d14c8STreehugger Robot
13*7c3d14c8STreehugger RobotRUN: %clang_profuse=%t-static.profdata -o %t-a.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-a.cpp
14*7c3d14c8STreehugger RobotRUN: %clang_profuse=%t-shared.profdata -o %t-a.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-a.cpp
15*7c3d14c8STreehugger RobotRUN: diff %t-a.static.ll %t-a.shared.ll
16*7c3d14c8STreehugger Robot
17*7c3d14c8STreehugger RobotRUN: %clang_profuse=%t-static.profdata -o %t-b.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-b.cpp
18*7c3d14c8STreehugger RobotRUN: %clang_profuse=%t-shared.profdata -o %t-b.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-b.cpp
19*7c3d14c8STreehugger RobotRUN: diff %t-b.static.ll %t-b.shared.ll
20*7c3d14c8STreehugger Robot
21*7c3d14c8STreehugger RobotRUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-main.cpp
22*7c3d14c8STreehugger RobotRUN: %clang_profuse=%t-shared.profdata -o %t-main.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-main.cpp
23*7c3d14c8STreehugger RobotRUN: diff %t-main.static.ll %t-main.shared.ll
24