summaryrefslogtreecommitdiffstats
path: root/test/CodeGenObjCXX/encode.mm
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-06-12 15:46:16 +0000
committerdim <dim@FreeBSD.org>2011-06-12 15:46:16 +0000
commitc49018d9cce52d8c9f34b44865ec3ba8e89a1488 (patch)
treec5e9e10bc189de0058aa763c47b9920a8351b7df /test/CodeGenObjCXX/encode.mm
parent110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab (diff)
downloadFreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.zip
FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.tar.gz
Vendor import of clang trunk r132879:
http://llvm.org/svn/llvm-project/cfe/trunk@132879
Diffstat (limited to 'test/CodeGenObjCXX/encode.mm')
-rw-r--r--test/CodeGenObjCXX/encode.mm70
1 files changed, 70 insertions, 0 deletions
diff --git a/test/CodeGenObjCXX/encode.mm b/test/CodeGenObjCXX/encode.mm
index 5a49feb..dce3d70 100644
--- a/test/CodeGenObjCXX/encode.mm
+++ b/test/CodeGenObjCXX/encode.mm
@@ -62,3 +62,73 @@ typedef float HGVec4f __attribute__ ((vector_size(16)));
@implementation RedBalloonHGXFormWrapper
@end
+// rdar://9357400
+namespace rdar9357400 {
+ template<int Dim1 = -1, int Dim2 = -1> struct fixed {
+ template<int D> struct rebind { typedef fixed<D> other; };
+ };
+
+ template<typename Element, int Size>
+ class fixed_1D
+ {
+ public:
+ typedef Element value_type;
+ typedef value_type array_impl[Size];
+ protected:
+ array_impl m_data;
+ };
+
+ template<typename Element, typename Alloc>
+ class vector;
+
+ template<typename Element, int Size>
+ class vector< Element, fixed<Size> >
+ : public fixed_1D<Element,Size> { };
+
+ typedef vector< float, fixed<4> > vector4f;
+
+ // CHECK: @_ZN11rdar9357400L2ggE = internal constant [49 x i8] c"{vector<float, rdar9357400::fixed<4, -1> >=[4f]}\00"
+ const char gg[] = @encode(vector4f);
+}
+
+struct Base1 {
+ char x;
+};
+
+struct DBase : public Base1 {
+ double x;
+ virtual ~DBase();
+};
+
+struct Sub_with_virt : virtual DBase {
+ long x;
+};
+
+struct Sub2 : public Sub_with_virt, public Base1, virtual DBase {
+ float x;
+};
+
+// CHECK: @_ZL2g1 = internal constant [10 x i8] c"{Base1=c}\00"
+const char g1[] = @encode(Base1);
+
+// CHECK: @_ZL2g2 = internal constant [14 x i8] c"{DBase=^^?cd}\00"
+const char g2[] = @encode(DBase);
+
+// CHECK: @_ZL2g3 = internal constant [26 x i8] c"{Sub_with_virt=^^?q^^?cd}\00"
+const char g3[] = @encode(Sub_with_virt);
+
+// CHECK: @_ZL2g4 = internal constant [19 x i8] c"{Sub2=^^?qcf^^?cd}\00"
+const char g4[] = @encode(Sub2);
+
+// http://llvm.org/PR9927
+class allocator {
+};
+class basic_string {
+struct _Alloc_hider : allocator {
+char* _M_p;
+};
+_Alloc_hider _M_dataplus;
+};
+
+// CHECK: @_ZL2g5 = internal constant [32 x i8] c"{basic_string={_Alloc_hider=*}}\00"
+const char g5[] = @encode(basic_string);
OpenPOWER on IntegriCloud