1 // RUN: %clang_cc1 -std=c++17 -emit-llvm %s -triple x86_64-windows-msvc -o - | FileCheck %s
3 // Make sure virtual base base destructors get referenced and emitted if
4 // necessary when the complete ("vbase") destructor is emitted. In this case,
5 // clang previously did not emit ~DefaultedDtor.
6 struct HasDtor
{ ~HasDtor(); };
8 ~DefaultedDtor() = default;
11 struct HasCompleteDtor
: virtual DefaultedDtor
{
14 void useCompleteDtor(HasCompleteDtor
*p
) { delete p
; }
16 // CHECK-LABEL: define dso_local void @"?useCompleteDtor@@YAXPEAUHasCompleteDtor@@@Z"(ptr noundef %p)
17 // CHECK: call void @"??_DHasCompleteDtor@@QEAAXXZ"({{.*}})
19 // CHECK-LABEL: define linkonce_odr dso_local void @"??_DHasCompleteDtor@@QEAAXXZ"(ptr {{[^,]*}} %this)
20 // CHECK: call void @"??1HasCompleteDtor@@QEAA@XZ"({{.*}})
21 // CHECK: call void @"??1DefaultedDtor@@QEAA@XZ"({{.*}})
23 // CHECK-LABEL: define linkonce_odr dso_local void @"??1DefaultedDtor@@QEAA@XZ"(ptr {{[^,]*}} %this)
24 // CHECK: call void @"??1HasDtor@@QEAA@XZ"(ptr {{[^,]*}} %{{.*}})