[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / devirtualize-dtor-final.cpp
blobb9a22450cdeb730faa3ebe8bf626dae3715a42d0
1 // RUN: %clang_cc1 -triple i386-unknown-unknown -std=c++11 %s -emit-llvm -o - | FileCheck %s
3 namespace 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_1BE
9 void foo(B *b) {
10 // CHECK: call void @_ZN5Test11BD1Ev
11 delete b;
13 // CHECK-LABEL: define{{.*}} void @_ZN5Test14foo2EPNS_1CE
14 void foo2(C *c) {
15 // CHECK: call void @_ZN5Test11CD1Ev
16 delete c;
18 // CHECK-LABEL: define{{.*}} void @_ZN5Test14evilEPNS_1DE
19 void evil(D *p) {
20 // CHECK-NOT: call void @_ZN5Test11DD1Ev
21 delete p;