summaryrefslogtreecommitdiffstats
path: root/test/Parser/cxx-altivec.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
committerdim <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
commit36c49e3f258dced101949edabd72e9bc3f1dedc4 (patch)
tree0bbe07708f7571f8b5291f6d7b96c102b7c99dee /test/Parser/cxx-altivec.cpp
parentfc84956ac8b7cd244ef30e7a4d4d38a58dec5904 (diff)
downloadFreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.zip
FreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.tar.gz
Vendor import of clang r114020 (from the release_28 branch):
http://llvm.org/svn/llvm-project/cfe/branches/release_28@114020 Approved by: rpaulo (mentor)
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 a70eea0..8f46330 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
+}
OpenPOWER on IntegriCloud