[PATCH] D143849: [Clang][OpenCL] Allow pointers in structs as kernel arguments from 2.0

Ayal Zaks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 14 07:17:15 PST 2023


Ayal added inline comments.


================
Comment at: clang/test/SemaOpenCL/invalid-kernel-parameters.cl:90
 
+#if __OPENCL_C_VERSION__ <= CL_VERSION_1_2
 typedef struct FooImage2D // expected-note{{within field of type 'FooImage2D' declared here}}
----------------
yaxunl wrote:
> Ayal wrote:
> > yaxunl wrote:
> > > we should not limit the tests to CL1.2. We should test them with 2.0 to make sure there is no diagnostics.
> > > 
> > > To differentiate between 1.2 and 2.0 you can use -verify=ocl12 and -verify=ocl20.
> > > 
> > > same as below
> > Using -verify=ocl12 and -verify=ocl20 should probably be done separately as an NFC patch as it involves many changes IIUC.
> > 
> > The expect's were placed under #ifdef instead (and only them), following e.g. existing lines 8-12.
> you can use -verify=expected,ocl12 for OCL1.2 and -verify for OCL2.0 then the common diagnostics are kept as 'expected-*' and unchanged. you only need to change the ocl1.2 specific diagnostics to 'ocl12-*'.
> 
> For example, https://github.com/llvm/llvm-project/blob/main/clang/test/SemaOpenCL/atomic-ops.cl
Ah, ok, done, thanks!

(Note that atomic-ops.cl uses only `expected`'s, some of which are placed under #if, as done elsewhere in this test file.)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143849/new/

https://reviews.llvm.org/D143849



More information about the cfe-commits mailing list