aboutsummaryrefslogtreecommitdiff
path: root/test/SemaOpenCL/vector_swizzle_length.cl
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-16 16:02:28 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-16 16:02:28 +0000
commit7442d6faa2719e4e7d33a7021c406c5a4facd74d (patch)
treec72b9241553fc9966179aba84f90f17bfa9235c3 /test/SemaOpenCL/vector_swizzle_length.cl
parentb52119637f743680a99710ce5fdb6646da2772af (diff)
Notes
Diffstat (limited to 'test/SemaOpenCL/vector_swizzle_length.cl')
-rw-r--r--test/SemaOpenCL/vector_swizzle_length.cl10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaOpenCL/vector_swizzle_length.cl b/test/SemaOpenCL/vector_swizzle_length.cl
new file mode 100644
index 000000000000..94e3f654d5d9
--- /dev/null
+++ b/test/SemaOpenCL/vector_swizzle_length.cl
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+
+typedef float float8 __attribute__((ext_vector_type(8)));
+
+void foo() {
+ float8 f2 = (float8)(0, 0, 0, 0, 0, 0, 0, 0);
+
+ f2.s01234; // expected-error {{vector component access has invalid length 5. Supported: 1,2,3,4,8,16}}
+ f2.xyzxy; // expected-error {{vector component access has invalid length 5. Supported: 1,2,3,4,8,16}}
+}