aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2009-12-15 18:13:04 +0000
committerNate Begeman <natebegeman@mac.com>2009-12-15 18:13:04 +0000
commit0479a0b9f22331da74df4ea50bce193f9bafb145 (patch)
treedc70d537a162489ef52fcaad45b2db7d6854223a /test
parentedd722e38b883236c9f214d5df309110500b3529 (diff)
Support OpenCL 1.1 odd-length vector component accessors.
For hi/odd of an odd-length vector, the last component is undefined. Since we shuffle with an undef vector, no CodeGen needs to change to support this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91437 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Sema/ext_vector_components.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/Sema/ext_vector_components.c b/test/Sema/ext_vector_components.c
index 48903024d3..8e42582cc7 100644
--- a/test/Sema/ext_vector_components.c
+++ b/test/Sema/ext_vector_components.c
@@ -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; }