blob: 0a6e08e2ff6280671c06dc5d98124c174be501b9 [file] [log] [blame]
John McCalld1e40d52011-10-02 01:16:38 +00001// RUN: %clang_cc1 -fobjc-gc -emit-llvm -triple x86_64-apple-darwin10.0.0 -fobjc-fragile-abi -o - %s | FileCheck %s
Fariborz Jahanian55bcace2010-06-15 22:44:06 +00002struct 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 id myobjc;
17 int array[3][4];
18};
19
20struct CopyByValue {
21 CopyByValue(const CopyByValue&);
22 CopyByValue &operator=(CopyByValue);
23};
24
25struct D : A, B, virtual C {
26 int scalar;
27 int scalar_array[2][3];
28 B class_member;
29 C class_member_array[2][3];
30 POD pod_array[2][3];
31
32 union {
33 int x;
34 float f[3];
35 };
36
37 CopyByValue by_value;
38};
39
40void test_D(D d1, D d2) {
41 d1 = d2;
42}
43
44// CHECK: define linkonce_odr %struct.D* @_ZN1DaSERS_
45// CHECK: {{call.*_ZN1AaSERS_}}
46// CHECK: {{call.*_ZN1BaSERS_}}
47// CHECK: {{call.*_ZN1CaSERKS_}}
48// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 24}}
49// CHECK: {{call.*_ZN1BaSERS_}}
50// CHECK: br
51// CHECK: {{call.*_ZN1CaSERKS_}}
52// CHECK: {{call.*@objc_memmove_collectable}}
53// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 12}}
54// CHECK: call void @_ZN11CopyByValueC1ERKS_
55// CHECK: {{call.*_ZN11CopyByValueaSES_}}
56// CHECK: ret
57