Anastasia added inline comments.

================
Comment at: test/SemaOpenCL/extension-begin.cl:26
+
 #ifndef IMPLICIT_INCLUDE
 #include "extension-begin.h"
----------------
sidorovd wrote:
> Anastasia wrote:
> > sidorovd wrote:
> > > Anastasia wrote:
> > > > Can we also test that macro `my_ext` is not defined here but defined 
> > > > above?
> > > > 
> > > > It seems we are not testing anything like this...
> > > #pragma OPENCL EXTENSION my_ext : begin doesn't define an appropriate 
> > > macro. And so cl-ext=+my_ext.
> > But don't you need to expose the definition of it?
> Certainly I need, but now the only proper way to do so is by adding an 
> extension via adding it in OpenCLExtensions.def. Previously we decided to 
> avoid adding an extension directly into clang, so with a new approach I'd 
> prefer not to add a definition of the macro in the header but define it 
> somewhere else, otherwise the macro becomes defined  where it's not supposed 
> to be (even for ARM and AMD =) ). 
However, my understanding is that you should define the macro when you define 
the extension itself.


```
#pragma OPENCL EXTENSION my_ext : begin
#define my_ext
...
#pragma OPENCL EXTENSION my_ext : end
```

does it not work for you?


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

https://reviews.llvm.org/D58666



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to