annotate clang/test/CodeGenObjCXX/implicit-copy-constructor.mm @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 79ff65ed7e25
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 struct A {
anatofuz
parents:
diff changeset
4 A();
anatofuz
parents:
diff changeset
5 A(const A&);
anatofuz
parents:
diff changeset
6 A(A&);
anatofuz
parents:
diff changeset
7 ~A();
anatofuz
parents:
diff changeset
8 };
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 struct B {
anatofuz
parents:
diff changeset
11 B();
anatofuz
parents:
diff changeset
12 B(B&);
anatofuz
parents:
diff changeset
13 };
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 struct C {
anatofuz
parents:
diff changeset
16 C() {}
anatofuz
parents:
diff changeset
17 C(C& other, A a = A());
anatofuz
parents:
diff changeset
18 int i, j;
anatofuz
parents:
diff changeset
19 };
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 struct POD {
anatofuz
parents:
diff changeset
22 id myobjc;
anatofuz
parents:
diff changeset
23 int array[3][4];
anatofuz
parents:
diff changeset
24 };
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 struct D : A, B, virtual C {
anatofuz
parents:
diff changeset
27 D();
anatofuz
parents:
diff changeset
28 int scalar;
anatofuz
parents:
diff changeset
29 int scalar_array[2][3];
anatofuz
parents:
diff changeset
30 B class_member;
anatofuz
parents:
diff changeset
31 C class_member_array[2][3];
anatofuz
parents:
diff changeset
32 POD pod_array[2][3];
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 union {
anatofuz
parents:
diff changeset
35 int x;
anatofuz
parents:
diff changeset
36 float f[3];
anatofuz
parents:
diff changeset
37 };
anatofuz
parents:
diff changeset
38 };
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40 void f(D d) {
anatofuz
parents:
diff changeset
41 D d2(d);
anatofuz
parents:
diff changeset
42 }
anatofuz
parents:
diff changeset
43
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
44 // CHECK-LABEL: define linkonce_odr void @_ZN1DC1ERS_(%struct.D* {{[^,]*}} %this, %struct.D* nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0) unnamed_addr
150
anatofuz
parents:
diff changeset
45 // CHECK: call void @_ZN1AC1Ev
anatofuz
parents:
diff changeset
46 // CHECK: call void @_ZN1CC2ERS_1A
anatofuz
parents:
diff changeset
47 // CHECK: call void @_ZN1AD1Ev
anatofuz
parents:
diff changeset
48 // CHECK: call void @_ZN1AC2ERS_
anatofuz
parents:
diff changeset
49 // CHECK: call void @_ZN1BC2ERS_
anatofuz
parents:
diff changeset
50 // CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 24}}
anatofuz
parents:
diff changeset
51 // CHECK: call void @_ZN1BC1ERS_
anatofuz
parents:
diff changeset
52 // CHECK: br label
anatofuz
parents:
diff changeset
53 // CHECK: call void @_ZN1AC1Ev
anatofuz
parents:
diff changeset
54 // CHECK: call void @_ZN1CC1ERS_1A
anatofuz
parents:
diff changeset
55 // CHECK: call void @_ZN1AD1Ev
anatofuz
parents:
diff changeset
56 // CHECK: {{icmp eq.*, 3}}
anatofuz
parents:
diff changeset
57 // CHECK: br i1
anatofuz
parents:
diff changeset
58 // CHECK: {{icmp eq.*, 2}}
anatofuz
parents:
diff changeset
59 // CHECK: br i1
anatofuz
parents:
diff changeset
60 // CHECK: {{call.*@objc_memmove_collectable}}
anatofuz
parents:
diff changeset
61 // CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 12}}
anatofuz
parents:
diff changeset
62 // CHECK: ret void
anatofuz
parents:
diff changeset
63
anatofuz
parents:
diff changeset
64
anatofuz
parents:
diff changeset
65 template<class T> struct X0 { void f0(T * ) { } };
anatofuz
parents:
diff changeset
66 template <class > struct X1 { X1( X1& , int = 0 ) { } };
anatofuz
parents:
diff changeset
67 struct X2 { X1<int> result; };
anatofuz
parents:
diff changeset
68 void test_X2()
anatofuz
parents:
diff changeset
69 {
anatofuz
parents:
diff changeset
70 typedef X2 impl;
anatofuz
parents:
diff changeset
71 typedef X0<impl> pimpl;
anatofuz
parents:
diff changeset
72 impl* i;
anatofuz
parents:
diff changeset
73 pimpl pdata;
anatofuz
parents:
diff changeset
74 pdata.f0( new impl(*i));
anatofuz
parents:
diff changeset
75 }