Home | History | Annotate | Download | only in CodeGenObjCXX
      1 // RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -disable-llvm-optzns -o - %s | FileCheck %s
      2 // rdar://18249673
      3 
      4 @class MyObject;
      5 struct base {
      6   ~base() = default;
      7 };
      8 struct derived : public base {
      9   MyObject *myobject;
     10 };
     11 
     12 void test1() {
     13   derived d1;
     14 }
     15 // CHECK-LABEL: define void @_Z5test1v()
     16 // CHECK: call void @_ZN7derivedC1Ev
     17 // CHECK: call void @_ZN7derivedD1Ev
     18 
     19 void test2() {
     20   derived *d2 = new derived;
     21   delete d2;
     22 }
     23 // CHECK-LABEL: define void @_Z5test2v()
     24 // CHECK:   call void @_ZN7derivedC1Ev
     25 // CHECK:   call void @_ZN7derivedD1Ev
     26 
     27 template <typename T>
     28 struct tderived : public base {
     29   MyObject *myobject;
     30 };
     31 void test3() {
     32   tderived<int> d1;
     33 }
     34 // CHECK-LABEL: define void @_Z5test3v()
     35 // CHECK: call void @_ZN8tderivedIiEC1Ev
     36 // CHECK: call void @_ZN8tderivedIiED1Ev
     37 
     38 void test4() {
     39   tderived<int> *d2 = new tderived<int>;
     40   delete d2;
     41 }
     42 // CHECK-LABEL: define void @_Z5test4v()
     43 // CHECK: call void @_ZN8tderivedIiEC1Ev
     44 // CHECK: call void @_ZN8tderivedIiED1Ev
     45 
     46 // CHECK-LABEL: define linkonce_odr void @_ZN7derivedD2Ev
     47 // CHECK: call void @objc_storeStrong(i8** {{.*}}, i8* null)
     48 
     49 // CHECK-LABEL: define linkonce_odr void @_ZN8tderivedIiED2Ev
     50 // CHECK: call void @objc_storeStrong(i8** {{.*}}, i8* null)
     51