diff --git a/clang/test/CIR/CodeGen/const-baseclass.cpp b/clang/test/CIR/CodeGen/const-baseclass.cpp new file mode 100644 index 000000000000..5f2669bfe23f --- /dev/null +++ b/clang/test/CIR/CodeGen/const-baseclass.cpp @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --input-file=%t.cir %s + +struct Empty { }; +struct A { +}; + +struct B : A, Empty { + B() : A(), Empty() { } +}; + +void f() { + B b1; +} + +// CHECK-LABEL: @_ZN1BC2Ev +// CHECK: %[[A:.*]] = cir.base_class_addr({{.*}}) [0] -> !cir.ptr +// CHECK: cir.call @_ZN1AC2Ev(%[[A:.*]]) : (!cir.ptr) -> () +// CHECK: %[[BASE:.*]] = cir.base_class_addr({{.*}}) [0] -> !cir.ptr +// CHECK: cir.call @_ZN5EmptyC2Ev(%[[BASE]]) : (!cir.ptr) -> () \ No newline at end of file