blob: 0ec89fceec5ba3f0ba16335ff83392443ae233e4 [file] [log] [blame]
Douglas Gregor06a9f362010-05-01 20:49:11 +00001// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin10.0.0 -o - %s | FileCheck %s
2struct A {
3 A &operator=(const A&);
4 A &operator=(A&);
5};
6
7struct B {
8 B &operator=(B&);
9};
10
11struct C {
12 virtual C& operator=(const C&);
13};
14
15struct POD {
16 int array[3][4];
17};
18
19struct CopyByValue {
20 CopyByValue(const CopyByValue&);
21 CopyByValue &operator=(CopyByValue);
22};
23
24struct D : A, B, virtual C {
25 int scalar;
26 int scalar_array[2][3];
27 B class_member;
28 C class_member_array[2][3];
29 POD pod_array[2][3];
30
31 union {
32 int x;
33 float f[3];
34 };
35
36 CopyByValue by_value;
37};
38
39void test_D(D d1, D d2) {
40 d1 = d2;
41}
42
43// CHECK: define linkonce_odr %struct.D* @_ZN1DaSERS_
44// CHECK: {{call.*_ZN1AaSERS_}}
45// CHECK: {{call.*_ZN1BaSERS_}}
46// CHECK: {{call.*_ZN1CaSERKS_}}
47// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 24}}
48// CHECK: {{call.*_ZN1BaSERS_}}
Douglas Gregor73622582010-05-03 15:51:04 +000049// CHECK: br
Douglas Gregor06a9f362010-05-01 20:49:11 +000050// CHECK: {{call.*_ZN1CaSERKS_}}
51// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 288}}
52// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 12}}
53// CHECK: call void @_ZN11CopyByValueC1ERKS_
54// CHECK: {{call.*_ZN11CopyByValueaSES_}}
55// CHECK: ret
56