================
@@ -0,0 +1,24 @@
+// REQUIRES: amdgpu-registered-target
+// RUN: %clang_cc1 -std=c++20 -triple amdgcn -target-cpu tahiti -fsyntax-only 
-fcuda-is-device -verify=expected -o - %s
+// RUN: %clang_cc1 -std=c++20 -triple amdgcn -target-cpu gfx950 -fsyntax-only 
-fcuda-is-device -o - %s
+
+#define __device__ __attribute__((device))
+#define __shared__ __attribute__((shared))
+
+struct S {
+    static constexpr auto make_buffer_rsrc_lambda = [](void *p, short stride, 
int num, int flags) {
+        return __builtin_amdgcn_make_buffer_rsrc(p, stride, num, flags);
+    };
+
+    static constexpr auto global_load_lds_lambda = [](void* src, __shared__ 
void *dst) {
+        __builtin_amdgcn_global_load_lds(src, dst, 16, 0, 0); // 
expected-error{{invalid size value}} expected-note{{size must be 1, 2, or 4}}
+    };
+};
+
----------------
jmmartinez wrote:

Add a test where we assign a value to a global outside a struct.

https://github.com/llvm/llvm-project/pull/135027
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to