Skip to content

Commit c7e6468

Browse files
committed
fixup! add missing test
1 parent 4e5002d commit c7e6468

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK
2+
3+
struct polymorphic_base {
4+
virtual void func() {}
5+
virtual ~polymorphic_base() {}
6+
};
7+
8+
struct Empty {};
9+
struct derived_virtual : virtual Empty {};
10+
struct derived : polymorphic_base {};
11+
12+
// CHECK: %struct.Holder1 = type { %struct.polymorphic_base }
13+
// CHECK: %struct.polymorphic_base = type { ptr }
14+
// CHECK: %struct.Holder2 = type { %struct.derived_virtual }
15+
// CHECK: %struct.derived_virtual = type { ptr }
16+
// CHECK: %struct.Holder3 = type { %struct.derived }
17+
// CHECK: %struct.derived = type { %struct.polymorphic_base }
18+
19+
struct Holder1 {
20+
polymorphic_base a{};
21+
} g_holder1;
22+
23+
// CHECK: @{{.*}}Holder1{{.*}} = {{.*}} global %struct.Holder1 { %struct.polymorphic_base { ptr {{.*}} } }
24+
25+
struct Holder2 {
26+
derived_virtual a{};
27+
} g_holder2;
28+
29+
// CHECK: @{{.*}}Holder2{{.*}} = {{.*}} global %struct.Holder2 zeroinitializer, align 8
30+
31+
struct Holder3 {
32+
derived a{};
33+
} g_holder3;
34+
35+
// CHECK: @{{.*}}Holder3{{.*}} = {{.*}} global { { ptr } } { { ptr } { ptr {{.*}} } }

0 commit comments

Comments
 (0)