Skip to content

Commit b92c3fe

Browse files
authored
[OpenMP] Fix test after updating library search paths (#83573)
Summary: We still use this bitcode library in one case, the NVPTX non-LTO build. The patch updated the search paths to treat it the same as other libraries, which unintentionally prioritized system paths over LIBRARY_PATH which is generally not correct. Also we had a test that relied on system state so remove that.
1 parent 2b4d67b commit b92c3fe

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2767,10 +2767,6 @@ void tools::addOpenMPDeviceRTL(const Driver &D,
27672767
const ToolChain &HostTC) {
27682768
SmallVector<StringRef, 8> LibraryPaths;
27692769

2770-
// Check all of the standard library search paths used by the compiler.
2771-
for (const auto &LibPath : HostTC.getFilePaths())
2772-
LibraryPaths.emplace_back(LibPath);
2773-
27742770
// Add user defined library paths from LIBRARY_PATH.
27752771
std::optional<std::string> LibPath =
27762772
llvm::sys::Process::GetEnv("LIBRARY_PATH");
@@ -2782,6 +2778,10 @@ void tools::addOpenMPDeviceRTL(const Driver &D,
27822778
LibraryPaths.emplace_back(Path.trim());
27832779
}
27842780

2781+
// Check all of the standard library search paths used by the compiler.
2782+
for (const auto &LibPath : HostTC.getFilePaths())
2783+
LibraryPaths.emplace_back(LibPath);
2784+
27852785
OptSpecifier LibomptargetBCPathOpt =
27862786
Triple.isAMDGCN() ? options::OPT_libomptarget_amdgpu_bc_path_EQ
27872787
: options::OPT_libomptarget_nvptx_bc_path_EQ;

clang/test/Driver/openmp-offload-gpu.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,6 @@
101101

102102
/// ###########################################################################
103103

104-
/// Check that the warning is thrown when the libomptarget bitcode library is not found.
105-
/// Libomptarget requires sm_52 or newer so an sm_52 bitcode library should never exist.
106-
// RUN: not %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
107-
// RUN: -Xopenmp-target -march=sm_52 --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
108-
// RUN: -fopenmp-relocatable-target -save-temps %s 2>&1 \
109-
// RUN: | FileCheck -check-prefix=CHK-BCLIB-WARN %s
110-
111-
// CHK-BCLIB-WARN: no library 'libomptarget-nvptx-sm_52.bc' found in the default clang lib directory or in LIBRARY_PATH; use '--libomptarget-nvptx-bc-path' to specify nvptx bitcode library
112-
113-
/// ###########################################################################
114-
115104
/// Check that the error is thrown when the libomptarget bitcode library does not exist.
116105
// RUN: not %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
117106
// RUN: -Xopenmp-target -march=sm_52 --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \

0 commit comments

Comments
 (0)