aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/ext_vector_components.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/ext_vector_components.c')
-rw-r--r--test/Sema/ext_vector_components.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/Sema/ext_vector_components.c b/test/Sema/ext_vector_components.c
index 48903024d3c6..7d3d52aa9546 100644
--- a/test/Sema/ext_vector_components.c
+++ b/test/Sema/ext_vector_components.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
typedef __attribute__(( ext_vector_type(2) )) float float2;
typedef __attribute__(( ext_vector_type(3) )) float float3;
@@ -26,8 +26,6 @@ static void test() {
f = vec2.x; // legal, shorten
f = vec4.xy.x; // legal, shorten
- vec2 = vec3.hi; // expected-error {{vector component access invalid for odd-sized type 'float3'}}
-
vec4_2.xyzx = vec4.xyzw; // expected-error {{vector is not assignable (contains duplicate components)}}
vec4_2.xyzz = vec4.xyzw; // expected-error {{vector is not assignable (contains duplicate components)}}
vec4_2.xyyw = vec4.xyzw; // expected-error {{vector is not assignable (contains duplicate components)}}
@@ -42,3 +40,8 @@ static void test() {
vec4p->yz = vec4p->xy;
}
+
+float2 lo(float3 x) { return x.lo; }
+float2 hi(float3 x) { return x.hi; }
+float2 ev(float3 x) { return x.even; }
+float2 od(float3 x) { return x.odd; }