summaryrefslogtreecommitdiff
path: root/test/Parser/cxx-altivec.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
committerDimitry Andric <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
commit3d1dcd9bfdb15c49ee34d576a065079ac5c4d29f (patch)
tree0bbe07708f7571f8b5291f6d7b96c102b7c99dee /test/Parser/cxx-altivec.cpp
parenta0482fa4e7fa27b01184f938097f0666b78016dd (diff)
Diffstat (limited to 'test/Parser/cxx-altivec.cpp')
-rw-r--r--test/Parser/cxx-altivec.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/Parser/cxx-altivec.cpp b/test/Parser/cxx-altivec.cpp
index a70eea077e7af..8f463308112bd 100644
--- a/test/Parser/cxx-altivec.cpp
+++ b/test/Parser/cxx-altivec.cpp
@@ -126,3 +126,38 @@ vector char v3 = (vector char)((vector int)('a', 'b', 'c', 'd'));
vector int v4 = (vector int)(1, 2, 3, 4);
vector float v5 = (vector float)(1.0f, 2.0f, 3.0f, 4.0f);
vector char v6 = (vector char)((vector int)(1+2, -2, (int)(2.0 * 3), -(5-3)));
+
+#if 0 // Not ready yet.
+// bug 7553 - Problem with '==' and vectors
+void func() {
+ vector int v10i = (vector int)(1, 2, 3, 4);
+ vector int v11i = (vector int)(1, 2, 3, 4);
+ bool r10ieq = (v10i == v11i);
+ bool r10ine = (v10i != v11i);
+ bool r10igt = (v10i > v11i);
+ bool r10ige = (v10i >= v11i);
+ bool r10ilt = (v10i < v11i);
+ bool r10ile = (v10i <= v11i);
+ vector float v10f = (vector float)(1.0f, 2.0f, 3.0f, 4.0f);
+ vector float v11f = (vector float)(1.0f, 2.0f, 3.0f, 4.0f);
+ bool r10feq = (v10f == v11f);
+ bool r10fne = (v10f != v11f);
+ bool r10fgt = (v10f > v11f);
+ bool r10fge = (v10f >= v11f);
+ bool r10flt = (v10f < v11f);
+ bool r10fle = (v10f <= v11f);
+}
+#endif
+
+// vecreturn attribute test
+struct Vector
+{
+ __vector float xyzw;
+} __attribute__((vecreturn));
+
+Vector Add(Vector lhs, Vector rhs)
+{
+ Vector result;
+ result.xyzw = vec_add(lhs.xyzw, rhs.xyzw);
+ return result; // This will (eventually) be returned in a register
+}