brintos

brintos / llvm-project-archived public Read only

0
0
Text · 737 B · 9ac8700 Raw
29 lines · cpp
1// RUN: %clang_cc1 -triple i686-linux-gnu %s -emit-llvm -o - | FileCheck %s2 3class A {4  // append has to have the same prototype as fn1 to tickle the bug.5  void (*append)(A *);6};7 8class B {};9class D;10 11// C has to be non-C++98 POD with available tail padding, making the LLVM base12// type differ from the complete LLVM type.13class C {14  // This member creates a circular LLVM type reference to %class.D.15  D *m_group;16  B changeListeners;17};18class D : C {};19 20A p1;21C p2;22D p3;23 24// We end up using an opaque type for 'append' to avoid circular references.25// CHECK: %class.A = type { ptr }26// CHECK: %class.C = type <{ ptr, [4 x i8] }>27// CHECK: %class.D = type { %class.C.base, [3 x i8] }28// CHECK: %class.C.base = type <{ ptr, i8 }>29