[llvm] [Offload][lit] Link against SPIR-V DeviceRTL if present (PR #180030)

Nick Sarnie via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 5 12:52:48 PST 2026


https://github.com/sarnex created https://github.com/llvm/llvm-project/pull/180030

Right now if we run lit tests the DeviceRTL isn't used because we pass `-nogpulib`.

Don't pass that, but also don't pass `--libomptarget-spirv-bc-path` yet because the DeviceRTL is brand new.

>From 9076456dc279676824594c967290d41be7b06527 Mon Sep 17 00:00:00 2001
From: Nick Sarnie <nick.sarnie at intel.com>
Date: Thu, 5 Feb 2026 12:50:02 -0800
Subject: [PATCH] [Offload][lit] Link against SPIR-V DeviceRTL if present

Signed-off-by: Nick Sarnie <nick.sarnie at intel.com>
---
 offload/test/lit.cfg | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/offload/test/lit.cfg b/offload/test/lit.cfg
index 0d5a9c95c1d95..0b98544e7bfa1 100644
--- a/offload/test/lit.cfg
+++ b/offload/test/lit.cfg
@@ -166,7 +166,8 @@ elif config.operating_system == 'Darwin':
     config.test_flags += " -Wl,-rpath," + config.library_dir
     config.test_flags += " -Wl,-rpath," + config.omp_host_rtl_directory
 else: # Unices
-    if config.libomptarget_current_target != "nvptx64-nvidia-cuda":
+    if config.libomptarget_current_target != "nvptx64-nvidia-cuda" and \
+    config.libomptarget_current_target != "spirv64-intel":
         config.test_flags += " -nogpulib"
     config.test_flags += " -Wl,-rpath," + config.library_dir
     config.test_flags += " -Wl,-rpath," + config.omp_host_rtl_directory
@@ -214,7 +215,8 @@ def add_libraries(source):
     if "gpu" not in config.available_features:
         return source
     if "intelgpu" in config.available_features:
-        # There is no DeviceRTL for Intel yet and libc doesn't work.
+        # SPIR-V uses an out-of-tree linker
+        # and libc doesn't work yet.
         return source
     if config.libomptarget_has_libc:
         return source + " -Xoffload-linker -lc " + \



More information about the llvm-commits mailing list