blob: 1c20535a58c993971133d034da3bec16b6cc5c74 [file] [log] [blame]
Chris Lattner90997ac2007-08-03 16:42:43 +00001// RUN: clang -emit-llvm %s
2
3typedef __attribute__(( ocu_vector_type(4) )) float float4;
4//typedef __attribute__(( ocu_vector_type(3) )) float float3;
5typedef __attribute__(( ocu_vector_type(2) )) float float2;
6
7
8float4 test1(float4 V) {
9 return V.wzyx+V;
10}
11
12float2 vec2, vec2_2;
13float4 vec4, vec4_2;
14float f;
15
16static void test2() {
17 vec2 = vec4.rg; // shorten
18 f = vec2.x; // extract elt
19 vec4 = vec4.yyyy; // splat
20
21 vec2.x = f; // insert one.
22 vec2.yx = vec2; // reverse
23}
24