]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGenObjCXX/inheriting-constructor-cleanup.mm
Vendor import of clang trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / test / CodeGenObjCXX / inheriting-constructor-cleanup.mm
1 // RUN: %clang_cc1 -triple x86_64-darwin -std=c++11 -fobjc-arc -emit-llvm -o - %s | FileCheck %s --implicit-check-not "call\ "
2 // rdar://problem/45805151
3
4 struct Strong {
5   __strong id x;
6 };
7
8 struct Base {
9   // Use variadic args to cause inlining the inherited constructor.
10   Base(Strong s, ...) {}
11 };
12
13 struct NonTrivialDtor {
14   ~NonTrivialDtor() {}
15 };
16 struct Inheritor : public NonTrivialDtor, public Base {
17   using Base::Base;
18 };
19
20 id g(void);
21 void f() {
22   Inheritor({g()});
23 }
24 // CHECK-LABEL: define void @_Z1fv
25 // CHECK:       %[[TMP:.*]] = call i8* @_Z1gv()
26 // CHECK:       {{.*}} = call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %[[TMP]])
27 // CHECK:       call void (%struct.Base*, i8*, ...) @_ZN4BaseC2E6Strongz(%struct.Base* {{.*}}, i8* {{.*}})
28 // CHECK-NEXT:  call void @_ZN9InheritorD1Ev(%struct.Inheritor* {{.*}})
29
30 // CHECK-LABEL: define linkonce_odr void @_ZN4BaseC2E6Strongz(%struct.Base* {{.*}}, i8* {{.*}}, ...)
31 // CHECK:       call void @_ZN6StrongD1Ev(%struct.Strong* {{.*}})
32
33 // CHECK-LABEL: define linkonce_odr void @_ZN9InheritorD1Ev(%struct.Inheritor* {{.*}})
34 // CHECK:       call void @_ZN9InheritorD2Ev(%struct.Inheritor* {{.*}})
35
36 // CHECK-LABEL: define linkonce_odr void @_ZN6StrongD1Ev(%struct.Strong* {{.*}})
37 // CHECK:       call void @_ZN6StrongD2Ev(%struct.Strong* {{.*}})
38
39 // CHECK-LABEL: define linkonce_odr void @_ZN6StrongD2Ev(%struct.Strong* {{.*}})
40 // CHECK:       call void @llvm.objc.storeStrong(i8** {{.*}}, i8* null)
41
42 // CHECK-LABEL: define linkonce_odr void @_ZN9InheritorD2Ev(%struct.Inheritor* {{.*}})
43 // CHECK:       call void @_ZN14NonTrivialDtorD2Ev(%struct.NonTrivialDtor* {{.*}})