36 lines · cpp
1// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK2 3struct polymorphic_base {4 virtual void func() {}5 virtual ~polymorphic_base() {}6};7 8struct Empty {};9struct derived_virtual : virtual Empty {};10struct 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 19struct Holder1 {20 polymorphic_base a{};21} g_holder1;22 23// CHECK: @{{.*}} = {{.*}}global %struct.Holder1 { %struct.polymorphic_base { ptr {{.*}} } }24 25struct Holder2 {26 derived_virtual a{};27} g_holder2;28 29// CHECK: @{{.*}} = {{.*}}global %struct.Holder2 zeroinitializer30 31struct Holder3 {32 derived a{};33} g_holder3;34 35// CHECK: @{{.*}} = {{.*}}global { { ptr } } { { ptr } { ptr {{.*}} } }36