Skip to content

Commit e744086

Browse files
committed
[CIR][CIRGen] Add missing testcase for null base class
Forgot to git add in cb0cb34
1 parent c1731b1 commit e744086

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
2+
// RUN: FileCheck --input-file=%t.cir %s
3+
4+
struct Empty { };
5+
struct A {
6+
};
7+
8+
struct B : A, Empty {
9+
B() : A(), Empty() { }
10+
};
11+
12+
void f() {
13+
B b1;
14+
}
15+
16+
// CHECK-LABEL: @_ZN1BC2Ev
17+
// CHECK: %[[A:.*]] = cir.base_class_addr({{.*}}) [0] -> !cir.ptr<!ty_A>
18+
// CHECK: cir.call @_ZN1AC2Ev(%[[A:.*]]) : (!cir.ptr<!ty_A>) -> ()
19+
// CHECK: %[[BASE:.*]] = cir.base_class_addr({{.*}}) [0] -> !cir.ptr<!ty_Empty>
20+
// CHECK: cir.call @_ZN5EmptyC2Ev(%[[BASE]]) : (!cir.ptr<!ty_Empty>) -> ()

0 commit comments

Comments
 (0)