Raphael Isemann a0c735e29a [lldb] Skip TestPointerToMemberTypeDependingOnParentSize on Windows and GCC
The test added in D100977 is failing to compile on these platforms. This seems
to be caused by GCC, MSVC and Clang@Windows rejecting the code because
`ToLayout` isn't complete when pointer_to_member_member is declared (even though
that seems to be valid code).

This also reverts the test changes in the lazy-loading test from D100977 as
that failed for the same reason.
2021-04-26 18:55:54 +02:00

73 lines
1.8 KiB
C++

//----------------------------------------------------------------------------//
// Struct loading declarations.
struct StructFirstMember { int i; };
struct StructBehindPointer { int i; };
struct StructBehindRef { int i; };
struct StructMember { int i; };
StructBehindRef struct_instance;
struct SomeStruct {
StructFirstMember *first;
StructBehindPointer *ptr;
StructMember member;
StructBehindRef &ref = struct_instance;
};
struct OtherStruct {
int member_int;
};
//----------------------------------------------------------------------------//
// Class loading declarations.
struct ClassMember { int i; };
struct StaticClassMember { int i; };
struct UnusedClassMember { int i; };
struct UnusedClassMemberPtr { int i; };
namespace NS {
class ClassInNamespace {
int i;
};
class ClassWeEnter {
public:
int dummy; // Prevent bug where LLDB always completes first member.
ClassMember member;
static StaticClassMember static_member;
UnusedClassMember unused_member;
UnusedClassMemberPtr *unused_member_ptr;
int enteredFunction() {
return member.i; // Location: class function
}
};
StaticClassMember ClassWeEnter::static_member;
};
//----------------------------------------------------------------------------//
// Function we can stop in.
int functionWithOtherStruct() {
OtherStruct other_struct_var;
other_struct_var.member_int++; // Location: other struct function
return other_struct_var.member_int;
}
int functionWithMultipleLocals() {
SomeStruct struct_var;
OtherStruct other_struct_var;
NS::ClassInNamespace namespace_class;
other_struct_var.member_int++; // Location: multiple locals function
return other_struct_var.member_int;
}
int main(int argc, char **argv) {
NS::ClassWeEnter c;
c.enteredFunction();
functionWithOtherStruct();
functionWithMultipleLocals();
return 0;
}