xref: /llvm-project/clang/test/CodeGenCXX/strict-vtable-pointers-GH67937.cpp (revision 5099dc341f7fa9baec160c2991072eb445469d46)
1*5099dc34SMatheus Izvekov // RUN: %clang_cc1 %s -I%S -triple=x86_64-pc-windows-msvc -fstrict-vtable-pointers -disable-llvm-passes -O1 -emit-llvm -o %t.ll
20fb1ad56SMatheus Izvekov // RUN: FileCheck %s < %t.ll
30fb1ad56SMatheus Izvekov 
40fb1ad56SMatheus Izvekov struct A {
50fb1ad56SMatheus Izvekov   virtual ~A();
60fb1ad56SMatheus Izvekov };
70fb1ad56SMatheus Izvekov struct B : virtual A {};
80fb1ad56SMatheus Izvekov class C : B {};
90fb1ad56SMatheus Izvekov C foo;
100fb1ad56SMatheus Izvekov 
110fb1ad56SMatheus Izvekov // CHECK-LABEL: define {{.*}} @"??0C@@QEAA@XZ"(ptr {{.*}} %this, i32 {{.*}} %is_most_derived)
120fb1ad56SMatheus Izvekov // CHECK: ctor.init_vbases:
130fb1ad56SMatheus Izvekov // CHECK-NEXT: %0 = getelementptr inbounds i8, ptr %this1, i64 0
140fb1ad56SMatheus Izvekov // CHECK-NEXT: store ptr @"??_8C@@7B@", ptr %0
150fb1ad56SMatheus Izvekov // CHECK-NEXT: %1 = call ptr @llvm.launder.invariant.group.p0(ptr %this1)
160fb1ad56SMatheus Izvekov // CHECK-NEXT: %2 = getelementptr inbounds i8, ptr %1, i64 8
170fb1ad56SMatheus Izvekov // CHECK-NEXT: %call = call noundef ptr @"??0A@@QEAA@XZ"(ptr {{.*}} %2) #2
180fb1ad56SMatheus Izvekov // CHECK-NEXT: br label %ctor.skip_vbases
190fb1ad56SMatheus Izvekov // CHECK-EMPTY:
200fb1ad56SMatheus Izvekov // CHECK-NEXT: ctor.skip_vbases:
21*5099dc34SMatheus Izvekov // CHECK-NEXT: %3 = call ptr @llvm.launder.invariant.group.p0(ptr %this1)
220fb1ad56SMatheus Izvekov // CHECK-NEXT: %call3 = call noundef ptr @"??0B@@QEAA@XZ"(ptr {{.*}} %3, i32 noundef 0) #2
23