1 // RUN: %clang_cc1 -fno-rtti -emit-llvm %s -o - -mconstructor-aliases -triple=i386-pc-win32 | FileCheck %s
2 // RUN: %clang_cc1 -fno-rtti -emit-llvm %s -o - -mconstructor-aliases -triple=i386-pc-win32 -fno-delete-null-pointer-checks | FileCheck %s
12 struct ChildNoOverride
: Left
, Right
{
15 struct ChildOverride
: Left
, Right
{
20 extern "C" void foo(void *);
22 void call_left_no_override(ChildNoOverride
*child
) {
23 // CHECK: %[[CHILD:.*]] = load ptr
27 void ChildOverride::left() {}
29 void call_right_no_override(ChildNoOverride
*child
) {
31 // When calling a right base's virtual method, one needs to adjust `this` at the caller site.
33 // CHECK: %[[RIGHT_i8:.*]] = getelementptr inbounds i8, ptr %[[CHILD]], i32 4
35 // CHECK: %[[VFTABLE:.*]] = load ptr, ptr %[[RIGHT_i8]]
36 // CHECK: %[[VFUN:.*]] = getelementptr inbounds ptr, ptr %[[VFTABLE]], i64 0
39 void ChildOverride::right() {
43 void call_right_override(ChildOverride
*child
) {
45 // Ensure that `nonnull` and `dereferenceable(N)` are not emitted whether or not null is valid
47 // CHECK: %[[RIGHT:.*]] = getelementptr inbounds i8, ptr %[[CHILD]], i32 4
48 // CHECK: %[[VFUN_VALUE:.*]] = load ptr, ptr %[[VFUN]]
49 // CHECK: call x86_thiscallcc void %[[VFUN_VALUE]](ptr noundef %[[RIGHT]])