blob: a343dd154cd94216a5c28552b314c763dedc972a [file] [log] [blame]
Douglas Gregorfb8cc252010-05-05 05:51:00 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
2
3struct A {
4 A();
5 A(const A&);
6 A(A&);
7 ~A();
8};
9
10struct B {
11 B();
12 B(B&);
13};
14
15struct C {
16 C() {}
17 C(C& other, A a = A());
18 int i, j;
19};
20
21struct POD {
22 int array[3][4];
23};
24
25struct D : A, B, virtual C {
26 D();
27 int scalar;
28 int scalar_array[2][3];
29 B class_member;
30 C class_member_array[2][3];
31 POD pod_array[2][3];
32
33 union {
34 int x;
35 float f[3];
36 };
37};
38
39void f(D d) {
40 D d2(d);
41}
42
43// CHECK: define linkonce_odr void @_ZN1DC1ERS_
44// CHECK: call void @_ZN1AC1Ev
45// CHECK: call void @_ZN1CC2ERS_1A
46// CHECK: call void @_ZN1AD1Ev
47// CHECK: call void @_ZN1AC2ERS_
48// CHECK: call void @_ZN1BC2ERS_
49// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 24}}
50// CHECK: call void @_ZN1BC1ERS_
51// CHECK: br
52// CHECK: {{icmp ult.*, 2}}
53// CHECK: {{icmp ult.*, 3}}
54// CHECK: call void @_ZN1AC1Ev
55// CHECK: call void @_ZN1CC1ERS_1A
56// CHECK: call void @_ZN1AD1Ev
57// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 288}}
58// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 12}}
59// CHECK: ret void
60
61
62template<class T> struct X0 { void f0(T * ) { } };
63template <class > struct X1 { X1( X1& , int = 0 ) { } };
64struct X2 { X1<int> result; };
65void test_X2()
66{
67 typedef X2 impl;
68 typedef X0<impl> pimpl;
69 impl* i;
70 pimpl pdata;
71 pdata.f0( new impl(*i));
72}