[cfe-commits] r40783 - /cfe/trunk/test/CodeGen/ocu-vector.c
Chris Lattner
sabre at nondot.org
Fri Aug 3 09:42:43 PDT 2007
Author: lattner
Date: Fri Aug 3 11:42:43 2007
New Revision: 40783
URL: http://llvm.org/viewvc/llvm-project?rev=40783&view=rev
Log:
testcase for vector element access stuff.
Added:
cfe/trunk/test/CodeGen/ocu-vector.c
Added: cfe/trunk/test/CodeGen/ocu-vector.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ocu-vector.c?rev=40783&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/ocu-vector.c (added)
+++ cfe/trunk/test/CodeGen/ocu-vector.c Fri Aug 3 11:42:43 2007
@@ -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
+}
+
More information about the cfe-commits
mailing list