summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Sema/vector_swizzle_length.c10
-rw-r--r--test/SemaOpenCL/vector_swizzle_length.cl2
2 files changed, 11 insertions, 1 deletions
diff --git a/test/Sema/vector_swizzle_length.c b/test/Sema/vector_swizzle_length.c
new file mode 100644
index 0000000000..5e6b1e7d67
--- /dev/null
+++ b/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;
+}
diff --git a/test/SemaOpenCL/vector_swizzle_length.cl b/test/SemaOpenCL/vector_swizzle_length.cl
index 94e3f654d5..4dbb5bd76e 100644
--- a/test/SemaOpenCL/vector_swizzle_length.cl
+++ b/test/SemaOpenCL/vector_swizzle_length.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+// RUN: %clang_cc1 -x cl %s -verify -pedantic -fsyntax-only
typedef float float8 __attribute__((ext_vector_type(8)));