[OpenMP] Fixed test environment of `check-libomptarget-nvptx`

D95161 removed the option `--libomptarget-nvptx-path`, which is used in
the tests for `libomptarget-nvptx`.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D95293

GitOrigin-RevId: cfd978d5d3c8a06813e25f69ff1386428380a7cb
diff --git a/libomptarget/deviceRTLs/nvptx/test/lit.cfg b/libomptarget/deviceRTLs/nvptx/test/lit.cfg
index a7a327c..5b9be32 100644
--- a/libomptarget/deviceRTLs/nvptx/test/lit.cfg
+++ b/libomptarget/deviceRTLs/nvptx/test/lit.cfg
@@ -32,8 +32,7 @@
 
 # compiler flags
 config.test_flags = " -I " + config.omp_header_directory + \
-    " -L " + config.library_dir + \
-    " --libomptarget-nvptx-path=" + config.library_dir;
+    " -L " + config.library_dir
 
 if config.omp_host_rtl_directory:
     config.test_flags = config.test_flags + \
@@ -42,6 +41,7 @@
 config.test_flags = config.test_flags + " " + config.test_extra_flags
 
 # Setup environment to find dynamic library at runtime.
+prepend_library_path('LIBRARY_PATH', config.library_dir, ":")
 prepend_library_path('LD_LIBRARY_PATH', config.library_dir, ":")
 prepend_library_path('LD_LIBRARY_PATH', config.omp_host_rtl_directory, ":")