azabaznov added inline comments.

================
Comment at: clang/test/SemaOpenCL/storageclass.cl:22
+extern generic float g_generic_extern_var;
+#ifndef __opencl_c_program_scope_global_variables
+// expected-error@-17 {{program scope variable must reside in constant address 
space}}
----------------
svenvh wrote:
> Not sure if this is the best way to restructure this test?  Now the 
> diagnostics are quite far away from the declarations, and it is harder to see 
> which diagnostic belongs to which declaration.
> 
> I wonder if the following would be a better structure instead:
> ```
> int G3 = 0;
> #ifndef __opencl_c_program_scope_global_variables
> // expected-error@-2 {{program scope variable must reside in constant address 
> space}}
> #endif
> 
> global int G4 = 0;
> #ifndef __opencl_c_program_scope_global_variables
> // expected-error@-2 {{program scope variable must reside in constant address 
> space}}
> #endif
> 
> ... etc. ...
> ```
> 
> The downside is that it is a bit more verbose due to the repetition of the 
> `#if` guards, but it makes the test more readable/maintainable in my opinion.
Yeah, that's reasonable. I'll change that in the following patch. Thanks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103191

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

Reply via email to