Skip to content

Commit 1d0a961

Browse files
Add llvm-profdata substitution to offload tests
1 parent 10e6c48 commit 1d0a961

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

offload/test/lit.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ config.available_features.add(config.libomptarget_current_target)
112112
if config.libomptarget_has_libc:
113113
config.available_features.add('libc')
114114

115+
profdata_path = os.path.join(config.bin_llvm_tools_dir, "llvm-profdata")
115116
if config.libomptarget_test_pgo:
116117
config.available_features.add('pgo')
118+
config.substitutions.append(("%profdata", profdata_path))
117119

118120
# Determine whether the test system supports unified memory.
119121
# For CUDA, this is the case with compute capability 70 (Volta) or higher.

offload/test/lit.site.cfg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@AUTO_GEN_COMMENT@
22

3-
config.bin_llvm_tools_dir = "@CMAKE_BINARY_DIR@/bin"
3+
config.bin_llvm_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
44
config.test_c_compiler = "@OPENMP_TEST_C_COMPILER@"
55
config.test_cxx_compiler = "@OPENMP_TEST_CXX_COMPILER@"
66
config.test_fortran_compiler="@OPENMP_TEST_Fortran_COMPILER@"

offload/test/offloading/pgo1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// RUN: %libomptarget-compile-generic -fprofile-generate \
22
// RUN: -Xclang "-fprofile-instrument=llvm"
33
// RUN: env LLVM_PROFILE_FILE=llvm.profraw %libomptarget-run-generic 2>&1
4-
// RUN: llvm-profdata show --all-functions --counts \
4+
// RUN: %profdata show --all-functions --counts \
55
// RUN: %target_triple.llvm.profraw | %fcheck-generic \
66
// RUN: --check-prefix="LLVM-PGO"
77

88
// RUN: %libomptarget-compile-generic -fprofile-instr-generate \
99
// RUN: -Xclang "-fprofile-instrument=clang"
1010
// RUN: env LLVM_PROFILE_FILE=clang.profraw %libomptarget-run-generic 2>&1
11-
// RUN: llvm-profdata show --all-functions --counts \
11+
// RUN: %profdata show --all-functions --counts \
1212
// RUN: %target_triple.clang.profraw | %fcheck-generic \
1313
// RUN: --check-prefix="CLANG-PGO"
1414

0 commit comments

Comments
 (0)