[llvm] [Offload] Tests for global memory and constructors (PR #147537)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 8 07:30:23 PDT 2025


================
@@ -0,0 +1,16 @@
+#include <gpuintrin.h>
+#include <stdint.h>
+
+[[clang::loader_uninitialized]]
+uint32_t global[64];
----------------
jhuber6 wrote:

Why the `[[]]` syntax here and `__attribute__` below? Prefer the newer syntax, (clang handles it and we can only compile this with clang anyway.) Also it's not necessary here because the global isn't LDS, we can just initialize it to zero.

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


More information about the llvm-commits mailing list