Home | History | Annotate | Download | only in CodeGenCXX
      1 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.7.0 -emit-llvm -o - %s | FileCheck %s
      2 
      3 struct X {
      4   X();
      5   ~X();
      6 };
      7 
      8 struct Y {
      9   X get();
     10 };
     11 
     12 struct X2 {
     13   X x;
     14 };
     15 
     16 template<typename T>
     17 void call() {
     18   Y().get();
     19 }
     20 
     21 // CHECK: define weak_odr void @_Z4callIiEvv
     22 // CHECK: call void @_ZN1Y3getEv
     23 // CHECK-NEXT: call void @_ZN1XD1Ev
     24 // CHECK-NEXT: ret void
     25 template void call<int>();
     26 
     27 template<typename T>
     28 void compound_literal() {
     29   (X2){};
     30 }
     31 
     32 // CHECK: define weak_odr void @_Z16compound_literalIiEvv
     33 // CHECK: call void @_ZN1XC1Ev
     34 // CHECK-NEXT: call void @_ZN2X2D1Ev
     35 // CHECK-NEXT: ret void
     36 template void compound_literal<int>();
     37 
     38