Make test more lenient for custom clang version strings
[llvm-project.git] / compiler-rt / test / profile / Linux / instrprof-debug-info-correlate.c
blob426426d9a05a29932ca6e348efed56c851268234
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
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
10 // RUN: llvm-profdata show --all-functions --counts %t.normal.profdata > %t.normal.dump
11 // RUN: llvm-profdata show --all-functions --counts %t.d4.profdata > %t.d4.dump
12 // RUN: diff %t.normal.dump %t.d4.dump
14 // 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
15 // RUN: env LLVM_PROFILE_FILE=%t.proflite %run %t
16 // RUN: llvm-profdata merge -o %t.profdata --debug-info=%t %t.proflite
18 // RUN: llvm-profdata show --all-functions --counts %t.normal.profdata > %t.normal2.dump
19 // RUN: llvm-profdata show --all-functions --counts %t.profdata > %t.prof.dump
20 // RUN: diff %t.normal2.dump %t.prof.dump
22 // 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
23 // RUN: env LLVM_PROFILE_FILE=%t.cov.proflite %run %t.cov
24 // RUN: llvm-profdata merge -o %t.cov.profdata --debug-info=%t.cov %t.cov.proflite
26 // 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
27 // RUN: env LLVM_PROFILE_FILE=%t.cov.profraw %run %t.cov.normal
28 // RUN: llvm-profdata merge -o %t.cov.normal.profdata %t.cov.profraw
30 // RUN: llvm-profdata show --all-functions --counts %t.cov.normal.profdata > %t.cov.normal.dump
31 // RUN: llvm-profdata show --all-functions --counts %t.cov.profdata > %t.cov.dump
32 // RUN: diff %t.cov.normal.dump %t.cov.dump
34 // Test debug info correlate with online merging.
36 // RUN: env LLVM_PROFILE_FILE=%t-1.profraw %run %t.normal
37 // RUN: env LLVM_PROFILE_FILE=%t-2.profraw %run %t.normal
38 // RUN: llvm-profdata merge -o %t.normal.profdata %t-1.profraw %t-2.profraw
40 // RUN: rm -rf %t.profdir && mkdir %t.profdir
41 // RUN: env LLVM_PROFILE_FILE=%t.profdir/%m.proflite %run %t
42 // RUN: env LLVM_PROFILE_FILE=%t.profdir/%m.proflite %run %t
43 // RUN: llvm-profdata merge -o %t.profdata --debug-info=%t %t.profdir/
45 // RUN: llvm-profdata show --all-functions --counts %t.normal.profdata > %t.normal3.dump
46 // RUN: llvm-profdata show --all-functions --counts %t.profdata > %t.prof3.dump
47 // RUN: diff %t.normal3.dump %t.prof3.dump
49 // RUN: rm -rf %t.profdir && mkdir %t.profdir
50 // RUN: env LLVM_PROFILE_FILE=%t.profdir/%m.cov.proflite %run %t.cov
51 // RUN: env LLVM_PROFILE_FILE=%t.profdir/%m.cov.proflite %run %t.cov
52 // RUN: llvm-profdata merge -o %t.cov.profdata --debug-info=%t.cov %t.profdir/
54 // RUN: llvm-profdata show --all-functions --counts %t.cov.normal.profdata > %t.cov.normal2.dump
55 // RUN: llvm-profdata show --all-functions --counts %t.cov.profdata > %t.cov2.dump
56 // RUN: diff %t.cov.normal2.dump %t.cov2.dump