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

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 13 08:31:00 PDT 2017


Anastasia 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};
 
----------------
Even though this works in Clang, ideally OpenCL vector literal is with parenthesis (see s6.1.6).


================
Comment at: test/SemaOpenCL/vector_swizzle_length.cl:13
+#else
+    // expected-no-diagnostics
+    (void)f2.s01234;
----------------
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.


https://reviews.llvm.org/D38868





More information about the cfe-commits mailing list