Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / pr18962.cpp
blobb564a7b9a73afd611d2f9991768c3a1947ac0218
1 // RUN: %clang_cc1 -triple i686-linux-gnu %s -emit-llvm -o - | FileCheck %s
3 class A {
4 // append has to have the same prototype as fn1 to tickle the bug.
5 void (*append)(A *);
6 };
8 class B {};
9 class D;
11 // C has to be non-C++98 POD with available tail padding, making the LLVM base
12 // type differ from the complete LLVM type.
13 class C {
14 // This member creates a circular LLVM type reference to %class.D.
15 D *m_group;
16 B changeListeners;
18 class D : C {};
20 A p1;
21 C p2;
22 D p3;
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, %class.B, [3 x i8] }>
27 // CHECK: %class.B = type { i8 }
28 // CHECK: %class.D = type { %class.C.base, [3 x i8] }
29 // CHECK: %class.C.base = type <{ ptr, %class.B }>