1// Value profiling is currently not supported in lightweight mode.
2// RUN: %clang_pgogen -o %t.normal -mllvm --disable-vp=true %S/../Inputs/instrprof-debug-info-correlate-main.cpp %S/../Inputs/instrprof-debug-info-correlate-foo.cpp
3// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t.normal
4// RUN: llvm-profdata merge -o %t.normal.profdata %t.profraw
5
6// RUN: %clang_pgogen -o %t.d4 -g -gdwarf-4 -mllvm --debug-info-correlate -mllvm --disable-vp=true %S/../Inputs/instrprof-debug-info-correlate-main.cpp %S/../Inputs/instrprof-debug-info-correlate-foo.cpp
7// RUN: env LLVM_PROFILE_FILE=%t.d4.proflite %run %t.d4
8// RUN: llvm-profdata merge -o %t.d4.profdata --debug-info=%t.d4 %t.d4.proflite
9
10// RUN: diff <(llvm-profdata show --all-functions --counts %t.normal.profdata) <(llvm-profdata show --all-functions --counts %t.d4.profdata)
11
12// RUN: %clang_pgogen -o %t -g -mllvm --debug-info-correlate -mllvm --disable-vp=true %S/../Inputs/instrprof-debug-info-correlate-main.cpp %S/../Inputs/instrprof-debug-info-correlate-foo.cpp
13// RUN: env LLVM_PROFILE_FILE=%t.proflite %run %t
14// RUN: llvm-profdata merge -o %t.profdata --debug-info=%t %t.proflite
15
16// RUN: diff <(llvm-profdata show --all-functions --counts %t.normal.profdata) <(llvm-profdata show --all-functions --counts %t.profdata)
17
18// RUN: %clang_pgogen -o %t.cov -g -mllvm --debug-info-correlate -mllvm -pgo-function-entry-coverage -mllvm --disable-vp=true %S/../Inputs/instrprof-debug-info-correlate-main.cpp %S/../Inputs/instrprof-debug-info-correlate-foo.cpp
19// RUN: env LLVM_PROFILE_FILE=%t.cov.proflite %run %t.cov
20// RUN: llvm-profdata merge -o %t.cov.profdata --debug-info=%t.cov %t.cov.proflite
21
22// RUN: %clang_pgogen -o %t.cov.normal -mllvm --pgo-function-entry-coverage -mllvm --disable-vp=true %S/../Inputs/instrprof-debug-info-correlate-main.cpp %S/../Inputs/instrprof-debug-info-correlate-foo.cpp
23// RUN: env LLVM_PROFILE_FILE=%t.cov.profraw %run %t.cov.normal
24// RUN: llvm-profdata merge -o %t.cov.normal.profdata %t.cov.profraw
25
26// RUN: diff <(llvm-profdata show --all-functions --counts %t.cov.normal.profdata) <(llvm-profdata show --all-functions --counts %t.cov.profdata)
27
28// Test debug info correlate with online merging.
29
30// RUN: env LLVM_PROFILE_FILE=%t-1.profraw %run %t.normal
31// RUN: env LLVM_PROFILE_FILE=%t-2.profraw %run %t.normal
32// RUN: llvm-profdata merge -o %t.normal.profdata %t-1.profraw %t-2.profraw
33
34// RUN: rm -rf %t.profdir && mkdir %t.profdir
35// RUN: env LLVM_PROFILE_FILE=%t.profdir/%m.proflite %run %t
36// RUN: env LLVM_PROFILE_FILE=%t.profdir/%m.proflite %run %t
37// RUN: llvm-profdata merge -o %t.profdata --debug-info=%t %t.profdir/
38
39// RUN: diff <(llvm-profdata show --all-functions --counts %t.normal.profdata) <(llvm-profdata show --all-functions --counts %t.profdata)
40
41// RUN: rm -rf %t.profdir && mkdir %t.profdir
42// RUN: env LLVM_PROFILE_FILE=%t.profdir/%m.cov.proflite %run %t.cov
43// RUN: env LLVM_PROFILE_FILE=%t.profdir/%m.cov.proflite %run %t.cov
44// RUN: llvm-profdata merge -o %t.cov.profdata --debug-info=%t.cov %t.profdir/
45
46// RUN: diff <(llvm-profdata show --all-functions --counts %t.cov.normal.profdata) <(llvm-profdata show --all-functions --counts %t.cov.profdata)
47

source code of compiler-rt/test/profile/Linux/instrprof-debug-info-correlate.c