mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 02:36:05 +00:00

This adds -no-opaque-pointers to clang tests whose output will change when opaque pointers are enabled by default. This is intended to be part of the migration approach described in https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9. The patch has been produced by replacing %clang_cc1 with %clang_cc1 -no-opaque-pointers for tests that fail with opaque pointers enabled. Worth noting that this doesn't cover all tests, there's a remaining ~40 tests not using %clang_cc1 that will need a followup change. Differential Revision: https://reviews.llvm.org/D123115
33 lines
839 B
C++
33 lines
839 B
C++
// RUN: %clang_cc1 -no-opaque-pointers -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 {};
|
|
|
|
void fn1(A *p1) {
|
|
}
|
|
|
|
void
|
|
fn2(C *) {
|
|
}
|
|
|
|
// We end up using an opaque type for 'append' to avoid circular references.
|
|
// CHECK: %class.A = type { {}* }
|
|
// CHECK: %class.C = type <{ %class.D*, %class.B, [3 x i8] }>
|
|
// CHECK: %class.D = type { %class.C.base, [3 x i8] }
|
|
// CHECK: %class.C.base = type <{ %class.D*, %class.B }>
|
|
// CHECK: %class.B = type { i8 }
|