brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · 09fb39c Raw
42 lines · c
1// REQUIRES: linux || windows2// REQUIRES: curl3 4// Default instrumented build with no profile correlation.5// RUN: %clang_profgen -o %t.default.exe -Wl,--build-id=0x12345678 -fprofile-instr-generate -fcoverage-mapping %S/Inputs/instrprof-debug-info-correlate-main.cpp %S/Inputs/instrprof-debug-info-correlate-foo.cpp6// RUN: env LLVM_PROFILE_FILE=%t.default.profraw %run %t.default.exe7// RUN: llvm-profdata merge -o %t.default.profdata %t.default.profraw8// RUN: llvm-profdata show --all-functions --counts %t.default.profdata > %t.default.profdata.show9 10// Build with profile binary correlation.11// RUN: %clang_profgen -o %t.correlate.exe -Wl,--build-id=0x12345678 -fprofile-instr-generate -fcoverage-mapping -mllvm -profile-correlate=binary %S/Inputs/instrprof-debug-info-correlate-main.cpp %S/Inputs/instrprof-debug-info-correlate-foo.cpp12// Strip above binary and run13// RUN: llvm-strip %t.correlate.exe -o %t.stripped.exe14// RUN: env LLVM_PROFILE_FILE=%t.correlate.profraw %run %t.stripped.exe15 16// Test llvm-profdata merge profile correlation with --debuginfod option.17// RUN: mkdir -p %t/buildid/1234567818// RUN: cp %t.correlate.exe %t/buildid/12345678/debuginfo19// RUN: mkdir -p %t/debuginfod-cache20// RUN: env DEBUGINFOD_CACHE_PATH=%t/debuginfod-cache DEBUGINFOD_URLS=file://%t llvm-profdata merge -o %t.correlate-debuginfod.profdata --debuginfod --correlate=binary %t.correlate.profraw21// RUN: llvm-profdata show --all-functions --counts %t.correlate-debuginfod.profdata > %t.correlate-debuginfod.profdata.show22// RUN: diff %t.default.profdata.show %t.correlate-debuginfod.profdata.show23 24// Test llvm-profdata merge profile correlation with --debug-file-directory option.25// RUN: mkdir -p %t/.build-id/1226// RUN: cp %t.correlate.exe %t/.build-id/12/345678.debug27// RUN: llvm-profdata merge -o %t.correlate-debug-file-dir.profdata --debug-file-directory %t --correlate=binary %t.correlate.profraw28// RUN: llvm-profdata show --all-functions --counts %t.correlate-debug-file-dir.profdata > %t.correlate-debug-file-dir.profdata.show29// RUN: diff %t.default.profdata.show %t.correlate-debug-file-dir.profdata.show30 31// Test error for llvm-profdata merge profile correlation with only --correlate=binary option.32// RUN: not llvm-profdata merge -o %t.correlate-error.profdata --correlate=binary %t.correlate.profraw 2>&1 | FileCheck %s --check-prefix=MISSING-FLAG33// MISSING-FLAG: error: Expected --debuginfod or --debug-file-directory when --correlate is provided34 35// Test error for llvm-profdata merge profile correlation when a proper --correlate option is not provided.36// RUN: not llvm-profdata merge -o %t.correlate-error.profdata --debug-file-directory %t --correlate="" %t.correlate.profraw 2>&1 | FileCheck %s --check-prefix=MISSING-CORRELATION-KIND37// MISSING-CORRELATION-KIND: error: Expected --correlate when --debug-file-directory is provided38 39// Test error for llvm-profdata merge profile correlation with mixing correlation options.40// RUN: not llvm-profdata merge -o %t.error.profdata --binary-file=%t.correlate.exe --debug-file-directory %t --correlate=binary %t.correlate.profraw  2>&1 | FileCheck %s --check-prefix=MIXING-FLAGS41// MIXING-FLAGS: error: Expected only one of -binary-file, -debuginfod or -debug-file-directory42