Skip to content

Commit

Permalink
[CIR][CIRGen] Add missing testcase for null base class
Browse files Browse the repository at this point in the history
Forgot to git add in cb0cb34
  • Loading branch information
bcardosolopes committed Oct 19, 2024
1 parent c1731b1 commit e744086
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions clang/test/CIR/CodeGen/const-baseclass.cpp
Original file line number Diff line number Diff line change
@@ -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<!ty_A>
// CHECK: cir.call @_ZN1AC2Ev(%[[A:.*]]) : (!cir.ptr<!ty_A>) -> ()
// CHECK: %[[BASE:.*]] = cir.base_class_addr({{.*}}) [0] -> !cir.ptr<!ty_Empty>
// CHECK: cir.call @_ZN5EmptyC2Ev(%[[BASE]]) : (!cir.ptr<!ty_Empty>) -> ()

0 comments on commit e744086

Please sign in to comment.