[PATCH] D38868: [OpenCL] Restrict swizzle length check to OpenCL mode

Bruno Cardoso Lopes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 13 11:45:06 PDT 2017


bruno marked 2 inline comments as done.
bruno added inline comments.


================
Comment at: test/SemaOpenCL/vector_swizzle_length.cl:7
 void foo() {
-    float8 f2 = (float8)(0, 0, 0, 0, 0, 0, 0, 0);
+    float8 f2 = (float8){0, 0, 0, 0, 0, 0, 0, 0};
 
----------------
Anastasia wrote:
> Even though this works in Clang, ideally OpenCL vector literal is with parenthesis (see s6.1.6).
Ok. I changed this to avoid warnings in C mode. Gonna change it back,


================
Comment at: test/SemaOpenCL/vector_swizzle_length.cl:13
+#else
+    // expected-no-diagnostics
+    (void)f2.s01234;
----------------
Anastasia wrote:
> I am not sure it's good idea to test C mode here since this is intended for OpenCL only functionality. I think it might be better to separate C functionality and keep under regular Sema tests. We could keep the same test name to be able to identify similar functionality.
Ok!


https://reviews.llvm.org/D38868





More information about the cfe-commits mailing list