File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
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 {{.*}} } }
You can’t perform that action at this time.
0 commit comments