[libc-commits] [libc] [libc] Implement lit-based test execution for Libc (PR #178746)

Jeff Bailey via libc-commits libc-commits at lists.llvm.org
Tue Feb 24 07:37:48 PST 2026


kaladron wrote:

> > Sorry, I got busy in the last half of last week. Is this still causing you troubles? If yes, is there any chance you can suggest how to replicate your environment?
> > Thanks!
> 
> Yes, see https://libc.llvm.org/gpu/building.html. You likely don't need to be able to successfully run the tests, follow the CMake options to set a default test architecture and make sure you have the `llvm-gpu-loader` utility. That should build if you have the LLVM libc enabled.
> 
> Just build it targeting AMD (you need lld) and set the test architecture to gfx1030 or something. If you actually have an AMD GPU you should just need ROCm installed.

Thanks for your help on Discord!  Some notetaking here for myself and others following along:

```
cmake ../llvm -G Ninja  \
   -DLLVM_ENABLE_PROJECTS="clang;lld"  \
   -DLLVM_ENABLE_RUNTIMES="openmp;offload" -DRUNTIMES_nvptx64-nvidia-cuda_LLVM_ENABLE_RUNTIMES=libc               \
   -DRUNTIMES_amdgcn-amd-amdhsa_LLVM_ENABLE_RUNTIMES=libc                 \
   -DLLVM_RUNTIME_TARGETS="default;amdgcn-amd-amdhsa;nvptx64-nvidia-cuda" \
   -DCMAKE_INSTALL_PREFIX=/tmp/gpu \
   -DRUNTIMES_amdgcn-amd-amdhsa_LIBC_GPU_TEST_ARCHITECTURE=gfx90a \
   -DRUNTIMES_nvptx64-nvidia-cuda_LIBC_GPU_TEST_ARCHITECTURE=sm_89 \
   -DRUNTIMES_amdgcn-amd-amdhsa_LIBC_GPU_LOADER_EXECUTABLE=/bin/echo \
   -DRUNTIMES_nvptx64-nvidia-cuda_LIBC_GPU_LOADER_EXECUTABLE=/bin/echo
```
When running `ninja -C runtimes/runtimes-amdgcn-amd-amdhsa-bins check-libc` will cause the commands to be echoed out, however when running `ninja -C runtimes/runtimes-amdgcn-amd-amdhsa-bins check-libc-lit` causes execution errors as the lit framework tries to run all the AMDGPU commands locally and doesn't prepend the LIBC_GPU_LOADER_EXECUTABLE.

@jdenny-ornl mentioned separately that `ninja check-all` was failing, and when I try that command I do get a lot of errors.  @jhuber6 suggested a different check command and that's working, so this doesn't appear to be blocking people right now.  I'll test this more and ensure that scenarios that worked before work after.

I'll try looking later this week, but it likely will spill into next week based on how my calendar looks.  And also, I might send a documentation patch in there. =)

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


More information about the libc-commits mailing list