Debian Codegraph @

clang/test/CodeGenObjCXX/inheriting-constructor-cleanup.mm

raw
1 // RUN: %clang_cc1 -triple x86_64-darwin -std=c++11 -fobjc-arc -emit-llvm -o - %s | FileCheck %s --implicit-check-not "call\ "
2
3 struct Strong {
4 __strong id x;
5 };
6
7 struct Base {
8 // Use variadic args to cause inlining the inherited constructor.
9 Base(Strong s, ...) {}
10 };
11
12 struct NonTrivialDtor {
13 ~NonTrivialDtor() {}
14 };
15 struct Inheritor : public NonTrivialDtor, public Base {
16 using Base::Base;
17 };
18
19 id g(void);
20 void f() {
21 Inheritor({g()});
22 }
23 // CHECK-LABEL: define{{.*}} void @_Z1fv
24 // CHECK: %[[TMP:.*]] = call noundef ptr @_Z1gv()
25 // CHECK: {{.*}} = notail call ptr @llvm.objc.retainAutoreleasedReturnValue(ptr %[[TMP]])
26 // CHECK: call void (ptr, ptr, ...) @_ZN4BaseC2E6Strongz(ptr {{.*}}, ptr {{.*}})
27 // CHECK-NEXT: call void @_ZN9InheritorD1Ev(ptr {{.*}})
28
29 // CHECK-LABEL: define linkonce_odr void @_ZN4BaseC2E6Strongz(ptr {{.*}}, ptr {{.*}}, ...)
30 // CHECK: call void @_ZN6StrongD1Ev(ptr {{.*}})
31
32 // CHECK-LABEL: define linkonce_odr void @_ZN9InheritorD1Ev(ptr {{.*}})
33 // CHECK: call void @_ZN9InheritorD2Ev(ptr {{.*}})
34
35 // CHECK-LABEL: define linkonce_odr void @_ZN6StrongD1Ev(ptr {{.*}})
36 // CHECK: call void @_ZN6StrongD2Ev(ptr {{.*}})
37
38 // CHECK-LABEL: define linkonce_odr void @_ZN6StrongD2Ev(ptr {{.*}})
39 // CHECK: call void @llvm.objc.storeStrong(ptr {{.*}}, ptr null)
40
41 // CHECK-LABEL: define linkonce_odr void @_ZN9InheritorD2Ev(ptr {{.*}})
42 // CHECK: call void @_ZN14NonTrivialDtorD2Ev(ptr {{.*}})