summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-03 16:42:43 +0000
committerChris Lattner <sabre@nondot.org>2007-08-03 16:42:43 +0000
commitb20b94de3a4c5e00e2aa46bb2750770c4e1f7818 (patch)
tree2c46d41656a8bbea3a81c2479e62c216397efd03
parent3a44aa74612b560a229906fb1d8354670d1af8f6 (diff)
testcase for vector element access stuff.
llvm-svn: 40783
-rw-r--r--clang/test/CodeGen/ocu-vector.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/CodeGen/ocu-vector.c b/clang/test/CodeGen/ocu-vector.c
new file mode 100644
index 000000000000..1c20535a58c9
--- /dev/null
+++ b/clang/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
+}
+