]> git.proxmox.com Git - rustc.git/blob - src/libcompiler_builtins/compiler-rt/test/profile/Linux/instrprof-dynamic-one-shared.test
New upstream version 1.20.0+dfsg1
[rustc.git] / src / libcompiler_builtins / compiler-rt / test / profile / Linux / instrprof-dynamic-one-shared.test
1 RUN: mkdir -p %t.d
2 RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections -o %t.d/a.shared -fPIC -shared %S/../Inputs/instrprof-dynamic-a.cpp
3 RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections -o %t-shared -fPIC -rpath %t.d %t.d/a.shared %S/../Inputs/instrprof-dynamic-b.cpp %S/../Inputs/instrprof-dynamic-main.cpp
4
5 RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections -o %t-static %S/../Inputs/instrprof-dynamic-a.cpp %S/../Inputs/instrprof-dynamic-b.cpp %S/../Inputs/instrprof-dynamic-main.cpp
6
7 RUN: env LLVM_PROFILE_FILE=%t-static.profraw %run %t-static
8 RUN: env LLVM_PROFILE_FILE=%t-shared.profraw %run %t-shared
9
10 RUN: llvm-profdata merge -o %t-static.profdata %t-static.profraw
11 RUN: llvm-profdata merge -o %t-shared.profdata %t-shared.profraw
12
13 RUN: %clang_profuse=%t-static.profdata -o %t-a.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-a.cpp
14 RUN: %clang_profuse=%t-shared.profdata -o %t-a.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-a.cpp
15 RUN: diff %t-a.static.ll %t-a.shared.ll
16
17 RUN: %clang_profuse=%t-static.profdata -o %t-b.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-b.cpp
18 RUN: %clang_profuse=%t-shared.profdata -o %t-b.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-b.cpp
19 RUN: diff %t-b.static.ll %t-b.shared.ll
20
21 RUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-main.cpp
22 RUN: %clang_profuse=%t-shared.profdata -o %t-main.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-main.cpp
23 RUN: diff %t-main.static.ll %t-main.shared.ll