1 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
3 // CHECK: v17@0:8{vector<float, float, float>=}16
4 // CHECK: {vector<float, float, float>=}
7 template <typename T1, typename T2, typename T3> struct vector {
12 typedef vector< float, float, float > vector3f;
19 @property (assign, nonatomic) vector3f position;
23 @interface MyOpenGLView
28 @property vector3f position;
31 @implementation MyOpenGLView
37 vector3f VF3(1.0, 1.0, 1.0);
43 class Int3 { int x, y, z; };
45 // Enforce @encoding for member pointers.
47 - (void) foo: (int (Int3::*)) member;
49 @implementation MemPtr
50 - (void) foo: (int (Int3::*)) member {
55 typedef float HGVec4f __attribute__ ((vector_size(16)));
57 @interface RedBalloonHGXFormWrapper {
58 HGVec4f m_Transform[4];
62 @implementation RedBalloonHGXFormWrapper
66 namespace rdar9357400 {
67 template<int Dim1 = -1, int Dim2 = -1> struct fixed {
68 template<int D> struct rebind { typedef fixed<D> other; };
71 template<typename Element, int Size>
75 typedef Element value_type;
76 typedef value_type array_impl[Size];
81 template<typename Element, typename Alloc>
84 template<typename Element, int Size>
85 class vector< Element, fixed<Size> >
86 : public fixed_1D<Element,Size> { };
88 typedef vector< float, fixed<4> > vector4f;
90 // CHECK: @_ZN11rdar93574002ggE = constant [49 x i8] c"{vector<float, rdar9357400::fixed<4, -1> >=[4f]}\00"
91 extern const char gg[] = @encode(vector4f);
95 namespace rdar9624314 {
100 // CHECK: @_ZN11rdar96243142ggE = constant [6 x i8] c"{S=i}\00"
101 extern const char gg[] = @encode(S);
103 struct S2 { unsigned : 0; int x; unsigned : 0; };
104 // CHECK: @_ZN11rdar96243142g2E = constant [11 x i8] c"{S2=b0ib0}\00"
105 extern const char g2[] = @encode(S2);
119 class Zoo : virtual public Foo, virtual public Bar {
125 // CHECK: @_ZN4test3ecdE = constant [15 x i8] c"{Zoo=^^?ii^^?}\00"
126 extern const char ecd[] = @encode(Zoo);
133 struct DBase : public Base1 {
138 struct Sub_with_virt : virtual DBase {
142 struct Sub2 : public Sub_with_virt, public Base1, virtual DBase {
146 // CHECK: @g1 = constant [10 x i8] c"{Base1=c}\00"
147 extern const char g1[] = @encode(Base1);
149 // CHECK: @g2 = constant [14 x i8] c"{DBase=^^?cd}\00"
150 extern const char g2[] = @encode(DBase);
152 // CHECK: @g3 = constant [26 x i8] c"{Sub_with_virt=^^?q^^?cd}\00"
153 extern const char g3[] = @encode(Sub_with_virt);
155 // CHECK: @g4 = constant [19 x i8] c"{Sub2=^^?qcf^^?cd}\00"
156 extern const char g4[] = @encode(Sub2);
158 // http://llvm.org/PR9927
162 struct _Alloc_hider : allocator {
165 _Alloc_hider _M_dataplus;
168 // CHECK: @g5 = constant [32 x i8] c"{basic_string={_Alloc_hider=*}}\00"
169 extern const char g5[] = @encode(basic_string);
174 virtual ~CefBase() {}
176 class CefBrowser : public virtual CefBase {};
177 class CefBrowserImpl : public CefBrowser {};
178 // CHECK: @g6 = constant [21 x i8] c"{CefBrowserImpl=^^?}\00"
179 extern const char g6[] = @encode(CefBrowserImpl);
183 virtual ~CefBase2() {}
186 class CefBrowser2 : public virtual CefBase2 {};
187 class CefBrowserImpl2 : public CefBrowser2 {};
188 // CHECK: @g7 = constant [26 x i8] c"{CefBrowserImpl2=^^?^^?i}\00"
189 extern const char g7[] = @encode(CefBrowserImpl2);
191 // <rdar://problem/11324167>
202 // CHECK: @g8 = constant [14 x i8] c"{Y={X=[10i]}}\00"
203 extern const char g8[] = @encode(Y);
206 class dynamic_class {
208 virtual ~dynamic_class();
210 @interface has_dynamic_class_ivar
212 @implementation has_dynamic_class_ivar {
213 dynamic_class dynamic_class_ivar;
216 // CHECK: internal global [41 x i8] c"{dynamic_class=\22_vptr$dynamic_class\22^^?}\00"
219 struct A { virtual ~A(); };
220 struct B : virtual A { int y; };
221 struct C { virtual ~C(); int z; };
222 struct D : C, B { int a; };
224 // CHECK: @_ZN7PR171421xE = constant [14 x i8] c"{E=^^?i^^?ii}\00"
225 extern const char x[] = @encode(E);