testcase for vector element access stuff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40783 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/ocu-vector.c b/test/CodeGen/ocu-vector.c
new file mode 100644
index 0000000..1c20535
--- /dev/null
+++ b/test/CodeGen/ocu-vector.c
@@ -0,0 +1,24 @@
+// RUN: clang -emit-llvm %s
+
+typedef __attribute__(( ocu_vector_type(4) )) float float4;
+//typedef __attribute__(( ocu_vector_type(3) )) float float3;
+typedef __attribute__(( ocu_vector_type(2) )) float float2;
+
+
+float4 test1(float4 V) {
+ return V.wzyx+V;
+}
+
+float2 vec2, vec2_2;
+float4 vec4, vec4_2;
+float f;
+
+static void test2() {
+ vec2 = vec4.rg; // shorten
+ f = vec2.x; // extract elt
+ vec4 = vec4.yyyy; // splat
+
+ vec2.x = f; // insert one.
+ vec2.yx = vec2; // reverse
+}
+