1*0a6a1f1dSLionel SambucRUN: mkdir -p %t.d 2*0a6a1f1dSLionel SambucRUN: %clang_profgen -o %t.d/a.shared -fPIC -shared %S/Inputs/instrprof-dynamic-a.cpp 3*0a6a1f1dSLionel SambucRUN: %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*0a6a1f1dSLionel Sambuc 5*0a6a1f1dSLionel SambucRUN: %clang_profgen -o %t-static %S/Inputs/instrprof-dynamic-a.cpp %S/Inputs/instrprof-dynamic-b.cpp %S/Inputs/instrprof-dynamic-main.cpp 6*0a6a1f1dSLionel Sambuc 7*0a6a1f1dSLionel SambucRUN: env LLVM_PROFILE_FILE=%t-static.profraw %run %t-static 8*0a6a1f1dSLionel SambucRUN: env LLVM_PROFILE_FILE=%t-shared.profraw %run %t-shared 9*0a6a1f1dSLionel Sambuc 10*0a6a1f1dSLionel SambucRUN: llvm-profdata merge -o %t-static.profdata %t-static.profraw 11*0a6a1f1dSLionel SambucRUN: llvm-profdata merge -o %t-shared.profdata %t-shared.profraw 12*0a6a1f1dSLionel Sambuc 13*0a6a1f1dSLionel SambucRUN: %clang_profuse=%t-static.profdata -o %t-a.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-a.cpp 14*0a6a1f1dSLionel SambucRUN: %clang_profuse=%t-shared.profdata -o %t-a.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-a.cpp 15*0a6a1f1dSLionel SambucRUN: diff %t-a.static.ll %t-a.shared.ll 16*0a6a1f1dSLionel Sambuc 17*0a6a1f1dSLionel SambucRUN: %clang_profuse=%t-static.profdata -o %t-b.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-b.cpp 18*0a6a1f1dSLionel SambucRUN: %clang_profuse=%t-shared.profdata -o %t-b.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-b.cpp 19*0a6a1f1dSLionel SambucRUN: diff %t-b.static.ll %t-b.shared.ll 20*0a6a1f1dSLionel Sambuc 21*0a6a1f1dSLionel SambucRUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-main.cpp 22*0a6a1f1dSLionel SambucRUN: %clang_profuse=%t-shared.profdata -o %t-main.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-main.cpp 23*0a6a1f1dSLionel SambucRUN: diff %t-main.static.ll %t-main.shared.ll 24