25 lines · c
1// REQUIRES: curl2// RUN: rm -rf %t3 4// Default instrumented build with no profile correlation.5// RUN: %clang_pgogen -o %t.default -Wl,--build-id=0x12345678 -mllvm --disable-vp=true %S/../Inputs/instrprof-debug-info-correlate-main.cpp %S/../Inputs/instrprof-debug-info-correlate-foo.cpp6// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t.default7// RUN: llvm-profdata merge -o %t.default.profdata %t.profraw8 9// Build with profile debuginfo correlation.10// RUN: %clang_pgogen -o %t.correlate.exe -Wl,--build-id=0x12345678 -g -gdwarf-4 -mllvm --profile-correlate=debug-info -mllvm --disable-vp=true %S/../Inputs/instrprof-debug-info-correlate-main.cpp %S/../Inputs/instrprof-debug-info-correlate-foo.cpp11// RUN: env LLVM_PROFILE_FILE=%t.debug-info-correlate.proflite %run %t.correlate.exe12 13// Test llvm-profdata merge profile correlation with --debuginfod option.14// RUN: mkdir -p %t/buildid/1234567815// RUN: cp %t.correlate.exe %t/buildid/12345678/debuginfo16// RUN: mkdir -p %t/debuginfod-cache17// RUN: env DEBUGINFOD_CACHE_PATH=%t/debuginfod-cache DEBUGINFOD_URLS=file://%t llvm-profdata merge -o %t.correlate-debuginfod.profdata --debuginfod --correlate=debug-info %t.debug-info-correlate.proflite18// RUN: diff <(llvm-profdata show --all-functions --counts %t.default.profdata) <(llvm-profdata show --all-functions --counts %t.correlate-debuginfod.profdata)19 20// Test llvm-profdata merge profile correlation with --debug-file-directory option.21// RUN: mkdir -p %t/.build-id/1222// RUN: cp %t.correlate.exe %t/.build-id/12/345678.debug23// RUN: llvm-profdata merge -o %t.correlate-debug-file-dir.profdata --debug-file-directory %t --correlate=debug-info %t.debug-info-correlate.proflite24// RUN: diff <(llvm-profdata show --all-functions --counts %t.default.profdata) <(llvm-profdata show --all-functions --counts %t.correlate-debug-file-dir.profdata)25