// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck %s struct A { ~A(); }; struct B { ~B() throw(int); }; struct C { B b; ~C() {} }; struct D { ~D() noexcept(false); }; struct E { D d; ~E() {} }; void foo() { A a; C c; E e; // CHECK: invoke {{.*}} @_ZN1ED1Ev // CHECK: invoke {{.*}} @_ZN1CD1Ev // CHECK: call {{.*}} @_ZN1AD1Ev } struct F { D d; ~F(); }; F::~F() noexcept(false) {} struct G { D d; ~G(); }; G::~G() {} struct H { B b; ~H() throw(int); }; H::~H() throw(int) {} struct I { B b; ~I(); }; I::~I() {} // Template variants. template struct TA { ~TA(); }; template struct TB { ~TB() throw(int); }; template struct TC { TB b; ~TC() {} }; template struct TD { ~TD() noexcept(false); }; template struct TE { TD d; ~TE() {} }; void tfoo() { TA a; TC c; TE e; // CHECK: invoke {{.*}} @_ZN2TEIiED1Ev // CHECK: invoke {{.*}} @_ZN2TCIiED1Ev // CHECK: call {{.*}} @_ZN2TAIiED1Ev } template struct TF { TD d; ~TF(); }; template TF::~TF() noexcept(false) {} template struct TG { TD d; ~TG(); }; template TG::~TG() {} template struct TH { TB b; ~TH(); }; template TH::~TH() {} void tinst() { TF f; TG g; TH h; } // CHECK: define linkonce_odr {{.*}} @_ZN2THIiED1Ev // CHECK: _ZTIi // CHECK: __cxa_call_unexpected struct VX { virtual ~VX() {} }; struct VY : VX { virtual ~VY() {} }; template struct TVY : VX { virtual ~TVY() {} }; struct VA { B b; virtual ~VA() {} }; struct VB : VA { virtual ~VB() {} }; template struct TVB : VA { virtual ~TVB() {} }; void tinst2() { TVY tvy; TVB tvb; } template struct Sw { T t; ~Sw() {} }; void tsw() { Sw swi; Sw swb; } // CHECK-NOT: define linkonce_odr {{.*}} @_ZN2SwI1BED1Ev({{.*}} # // CHECK: define linkonce_odr {{.*}} @_ZN2SwI1BED1Ev({{.*}} // CHECK: _ZTIi // CHECK: __cxa_call_unexpected // CHECK: define linkonce_odr {{.*}} @_ZN2SwIiED1Ev({{.*}} [[ATTRGRP:#[0-9]+]] template struct TVC : VX { virtual ~TVC(); }; template TVC::~TVC() {} // CHECK: attributes [[ATTRGRP]] = { noinline nounwind{{.*}} }