[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / virtual-destructor-calls.cpp
blobefb4a14aa299b9b3f314d2308d48584b869f5633
1 // RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin10 -mconstructor-aliases -O1 -disable-llvm-passes | FileCheck %s
3 struct Member {
4 ~Member();
5 };
7 struct A {
8 virtual ~A();
9 };
11 struct B : A {
12 Member m;
13 virtual ~B();
16 // Complete dtor: just an alias because there are no virtual bases.
17 // CHECK: @_ZN1BD1Ev ={{.*}} unnamed_addr alias {{.*}} @_ZN1BD2Ev
19 // (aliases from C)
20 // CHECK: @_ZN1CD2Ev ={{.*}} unnamed_addr alias {{.*}}, bitcast {{.*}} @_ZN1BD2Ev
21 // CHECK: @_ZN1CD1Ev ={{.*}} unnamed_addr alias {{.*}} @_ZN1CD2Ev
23 // Base dtor: actually calls A's base dtor.
24 // CHECK-LABEL: define{{.*}} void @_ZN1BD2Ev(%struct.B* {{[^,]*}} %this) unnamed_addr
25 // CHECK: call void @_ZN6MemberD1Ev
26 // CHECK: call void @_ZN1AD2Ev
28 // Deleting dtor: defers to the complete dtor.
29 // CHECK-LABEL: define{{.*}} void @_ZN1BD0Ev(%struct.B* {{[^,]*}} %this) unnamed_addr
30 // CHECK: call void @_ZN1BD1Ev
31 // CHECK: call void @_ZdlPv
33 B::~B() { }
35 struct C : B {
36 ~C();
39 C::~C() { }
41 // Complete dtor: just an alias (checked above).
43 // Deleting dtor: defers to the complete dtor.
44 // CHECK-LABEL: define{{.*}} void @_ZN1CD0Ev(%struct.C* {{[^,]*}} %this) unnamed_addr
45 // CHECK: call void @_ZN1CD1Ev
46 // CHECK: call void @_ZdlPv
48 // Base dtor: just an alias to B's base dtor.
50 namespace PR12798 {
51 // A qualified call to a base class destructor should not undergo virtual
52 // dispatch. Template instantiation used to lose the qualifier.
53 struct A { virtual ~A(); };
54 template<typename T> void f(T *p) { p->A::~A(); }
56 // CHECK: define {{.*}} @_ZN7PR127981fINS_1AEEEvPT_(
57 // CHECK: call void @_ZN7PR127981AD1Ev(
58 template void f(A*);