[PATCH] D115640: [OpenCL] Add support of __opencl_c_device_enqueue feature macro.

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 24 07:45:08 PST 2022


Anastasia added inline comments.


================
Comment at: clang/test/Misc/opencl-c-3.0.incorrect_options.cl:21
+
 // CHECK-FP64: error: options cl_khr_fp64 and __opencl_c_fp64 are set to different values
 
----------------
azabaznov wrote:
> Anastasia wrote:
> > Anastasia wrote:
> > > I can't remember if we have discussed this already, but could we use `-verify` for these errors?
> > We should be able to remove `FileCheck` and replace `CHECK` directives with something like:
> > `//expected-error@*{{options cl_khr_fp64 and __opencl_c_fp64 are set to different values}}`
> I don't think we can test it like this because there is different output for each invalid combination, so we need to check them with label.
We normally use macros to guard the expected errors but however, this is a better fit for a refactoring patch... so I am ok if it's done separately...  

However, don't you need to add

```
//expected-no-diagnostics
```
directive?


================
Comment at: clang/test/SemaOpenCL/storageclass.cl:2
 // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2
-// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=-__opencl_c_program_scope_global_variables,-__opencl_c_generic_address_space,-__opencl_c_pipes
-// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_program_scope_global_variables,-__opencl_c_generic_address_space,-__opencl_c_pipes
-// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=-__opencl_c_program_scope_global_variables,+__opencl_c_generic_address_space
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=-__opencl_c_program_scope_global_variables,-__opencl_c_generic_address_space,-__opencl_c_pipes,-__opencl_c_device_enqueue
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_program_scope_global_variables,-__opencl_c_generic_address_space,-__opencl_c_pipes,-__opencl_c_device_enqueue
----------------
azabaznov wrote:
> Anastasia wrote:
> > Anastasia wrote:
> > > These lines are getting a bit longer. Do we actually need to set `-__opencl_c_device_enqueue` for this test? Same for some other tests...
> > ping
> Yeah, we need that here because we are turning off generic AS and PSV in this test. Note that `__opencl_c_device_enqueue` is turned off with `-cl-ext=-all`.
since this test doesn't check anything for `__opencl_c_device_enqueue` why do we need to switch this off explicitly?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115640



More information about the cfe-commits mailing list