These tests all require some adjustments to make sure that struct types still get generated, mostly done by stripping pointer indirections. Some of this may no longer test the situation it was originally intended for, e.g. the issue from pr18962 just doesn't really exist anymore with opaque pointers, as we no longer generate recursive types.
30 lines
786 B
C++
30 lines
786 B
C++
// RUN: %clang_cc1 -triple i686-linux-gnu %s -emit-llvm -o - | FileCheck %s
|
|
|
|
class A {
|
|
// append has to have the same prototype as fn1 to tickle the bug.
|
|
void (*append)(A *);
|
|
};
|
|
|
|
class B {};
|
|
class D;
|
|
|
|
// C has to be non-C++98 POD with available tail padding, making the LLVM base
|
|
// type differ from the complete LLVM type.
|
|
class C {
|
|
// This member creates a circular LLVM type reference to %class.D.
|
|
D *m_group;
|
|
B changeListeners;
|
|
};
|
|
class D : C {};
|
|
|
|
A p1;
|
|
C p2;
|
|
D p3;
|
|
|
|
// We end up using an opaque type for 'append' to avoid circular references.
|
|
// CHECK: %class.A = type { ptr }
|
|
// CHECK: %class.C = type <{ ptr, %class.B, [3 x i8] }>
|
|
// CHECK: %class.B = type { i8 }
|
|
// CHECK: %class.D = type { %class.C.base, [3 x i8] }
|
|
// CHECK: %class.C.base = type <{ ptr, %class.B }>
|