diff options
author | Nate Begeman <natebegeman@mac.com> | 2009-12-15 18:13:04 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2009-12-15 18:13:04 +0000 |
commit | ac8183a83066b9dec45c6c9cebb6ac9691df1324 (patch) | |
tree | b160521ae709f6c851d8446eb1a6ae1ac24e6c0e /clang/test | |
parent | 4ec123710663b5b850eda0baee1e67b23832c4de (diff) | |
download | bcm5719-llvm-ac8183a83066b9dec45c6c9cebb6ac9691df1324.tar.gz bcm5719-llvm-ac8183a83066b9dec45c6c9cebb6ac9691df1324.zip |
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.
llvm-svn: 91437
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Sema/ext_vector_components.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/test/Sema/ext_vector_components.c b/clang/test/Sema/ext_vector_components.c index 48903024d3c..8e42582cc72 100644 --- a/clang/test/Sema/ext_vector_components.c +++ b/clang/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; } |