summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/vector_swizzle_length.c
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2017-10-17 17:54:57 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2017-10-17 17:54:57 +0000
commit9e5751894d5f495fb62aa7d3aa6188af44b3a3f3 (patch)
tree127c60e4c11a7f0380ebdd766f3d5e0a8696dd14 /clang/test/Sema/vector_swizzle_length.c
parentcbb287c2ecbde244db67cedb817933628a991f55 (diff)
downloadbcm5719-llvm-9e5751894d5f495fb62aa7d3aa6188af44b3a3f3.tar.gz
bcm5719-llvm-9e5751894d5f495fb62aa7d3aa6188af44b3a3f3.zip
[OpenCL] Restrict swizzle length check to OpenCL mode
Changes behavior introduced in r298369 to only error out on vector component invalid length access on OpenCL mode. Differential Revision: https://reviews.llvm.org/D38868 rdar://problem/33568748 llvm-svn: 316016
Diffstat (limited to 'clang/test/Sema/vector_swizzle_length.c')
-rw-r--r--clang/test/Sema/vector_swizzle_length.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Sema/vector_swizzle_length.c b/clang/test/Sema/vector_swizzle_length.c
new file mode 100644
index 00000000000..5e6b1e7d67a
--- /dev/null
+++ b/clang/test/Sema/vector_swizzle_length.c
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -x c %s -verify -pedantic -fsyntax-only
+// expected-no-diagnostics
+
+typedef float float8 __attribute__((ext_vector_type(8)));
+
+void foo() {
+ float8 f2 = (float8){0, 0, 0, 0, 0, 0, 0, 0};
+ (void)f2.s01234;
+ (void)f2.xyzxy;
+}
OpenPOWER on IntegriCloud