[clang] [offload-arch] Fix amdgpu HIP DLL search path on Windows (PR #209898)

Scott Todd via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 15 14:49:19 PDT 2026


================
@@ -25,6 +32,37 @@ cl::opt<bool> Verbose("offload-arch-test-verbose", cl::Hidden, cl::init(false));
 
 #ifdef _WIN32
 
+// --- primeLibraryLoad ---
+
+namespace {
+std::wstring CapturedPath;
+HANDLE CapturedFile;
+DWORD CapturedFlags;
+
+HMODULE WINAPI mockLoadLibraryExW(LPCWSTR Path, HANDLE File, DWORD Flags) {
----------------
ScottTodd wrote:

Hmmm.. I found https://github.com/llvm/llvm-project/tree/main/llvm/unittests/Support/DynamicLibrary which might let us
1. create a fake `amdhip64_*.dll`
2. create a second fake DLL that it imports a symbol from
3. put both into a new directory (off PATH and CWD) so the loader needs to work to access them
4. call the real function

https://github.com/llvm/llvm-project/pull/209898


More information about the cfe-commits mailing list