================
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -x hip -aux-triple 
amdgcn-amd-amdhsa %s -fsyntax-only -verify
+
+#define __device__ __attribute__((device))
+
+__device__ __buffer_rsrc_t test_buffer_rsrc_t_device() {} // expected-warning 
{{non-void function does not return a value}}
+__buffer_rsrc_t test_buffer_rsrc_t_host() {} // expected-error 
{{'__buffer_rsrc_t' can only be used in device-side function}}
----------------
shiltian wrote:
@yxsamliu I forced that the type is only available if the target triple or the 
aux target triple is amdgpu. However, that doesn't force the check that 
`__buffer_rsrc_t` can only be used in device-side function. How do we do this 
kind of type check in Sema?

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

Reply via email to