[llvm] [OFFLOAD] Enable Level Zero unittests (PR #185492)

Nick Sarnie via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 12:05:09 PDT 2026


================
@@ -102,6 +102,24 @@ function(add_offload_test_device_code test_filename test_name)
     endif()
   endif()
 
+  # Try to build with support for Level Zero SPIRV devices.
+  if("level_zero" IN_LIST LIBOMPTARGET_PLUGINS_TO_BUILD)
+    set(spirv_compile_flags ${OFFLOAD_TESTS_UNPARSED_ARGUMENTS})
+    set(output_file "${CMAKE_CURRENT_BINARY_DIR}/${test_name}.spirv64.bin")
+    # TODO: building for specific device is not implemented yet.
+    # TODO: remove the -ffreestanding flag once the libc for spirv64-intel target will be available.
----------------
sarnex wrote:

```suggestion
    # TODO: Remove the -ffreestanding flag once libc can be built for spirv64.
```

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


More information about the llvm-commits mailing list