brintos

brintos / llvm-project-archived public Read only

0
0
Text · 672 B · b9a2245 Raw
24 lines · cpp
1// RUN: %clang_cc1 -triple i386-unknown-unknown -std=c++11 %s -emit-llvm -o - | FileCheck %s2 3namespace Test1 {4  struct A { virtual ~A() {} };5  struct B final : A {};6  struct C : A { virtual ~C() final {} };7  struct D { virtual ~D() final = 0; };8  // CHECK-LABEL: define{{.*}} void @_ZN5Test13fooEPNS_1BE9  void foo(B *b) {10    // CHECK: call void @_ZN5Test11BD1Ev11    delete b;12  }13  // CHECK-LABEL: define{{.*}} void @_ZN5Test14foo2EPNS_1CE14  void foo2(C *c) {15    // CHECK: call void @_ZN5Test11CD1Ev16    delete c;17  }18  // CHECK-LABEL: define{{.*}} void @_ZN5Test14evilEPNS_1DE19  void evil(D *p) {20    // CHECK-NOT: call void @_ZN5Test11DD1Ev21    delete p;22  }23}24