diff options
author | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
commit | 39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df (patch) | |
tree | a9243275843fbeaa590afc07ee888e006b8d54ea /test/Parser/cxx-altivec.cpp | |
parent | 69b4eca4a4255ba43baa5c1d9bbdec3ec17f479e (diff) | |
download | FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.zip FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.tar.gz |
Vendor import of clang trunk r126079:
http://llvm.org/svn/llvm-project/cfe/trunk@126079
Diffstat (limited to 'test/Parser/cxx-altivec.cpp')
-rw-r--r-- | test/Parser/cxx-altivec.cpp | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/test/Parser/cxx-altivec.cpp b/test/Parser/cxx-altivec.cpp index 8f46330..4d92450 100644 --- a/test/Parser/cxx-altivec.cpp +++ b/test/Parser/cxx-altivec.cpp @@ -127,27 +127,17 @@ 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); + bool res_b; + res_b = (vv_sc == vv_sc); + res_b = (vv_uc != vv_uc); + res_b = (vv_s > vv_s); + res_b = (vv_us >= vv_us); + res_b = (vv_i < vv_i); + res_b = (vv_ui <= vv_ui); + res_b = (vv_f <= vv_f); } -#endif // vecreturn attribute test struct Vector @@ -161,3 +151,20 @@ Vector Add(Vector lhs, Vector rhs) result.xyzw = vec_add(lhs.xyzw, rhs.xyzw); return result; // This will (eventually) be returned in a register } + +// vecreturn attribute test - should error because of virtual function. +class VectorClassNonPod +{ + __vector float xyzw; +public: + VectorClassNonPod() {} + virtual ~VectorClassNonPod() {} +} __attribute__((vecreturn)); // expected-error {{the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)}} + +// vecreturn attribute test - should error because of virtual function. +class VectorClassMultipleMembers +{ +public: + __vector float xyzw; + __vector float abcd; +} __attribute__((vecreturn)); // expected-error {{the vecreturn attribute can only be used on a class or structure with one member, which must be a vector}} |