You've already forked linux-packaging-mono
Imported Upstream version 5.18.0.207
Former-commit-id: 3b152f462918d427ce18620a2cbe4f8b79650449
This commit is contained in:
parent
8e12397d70
commit
eb85e2fc17
@ -1,64 +0,0 @@
|
||||
// Compile with "cl /c /Zi /GR- ClassLayoutTest.cpp"
|
||||
// Link with "link ClassLayoutTest.obj /debug /nodefaultlib /entry:main"
|
||||
|
||||
namespace MembersTest {
|
||||
class A {
|
||||
public:
|
||||
typedef int NestedTypedef;
|
||||
enum NestedEnum {
|
||||
NestedEnumValue1
|
||||
};
|
||||
|
||||
void MemberFunc() {}
|
||||
|
||||
private:
|
||||
int IntMemberVar;
|
||||
double DoubleMemberVar;
|
||||
};
|
||||
}
|
||||
|
||||
namespace GlobalsTest {
|
||||
int IntVar;
|
||||
double DoubleVar;
|
||||
|
||||
typedef int Typedef;
|
||||
enum Enum {
|
||||
Val1
|
||||
} EnumVar;
|
||||
Typedef TypedefVar;
|
||||
}
|
||||
|
||||
namespace BaseClassTest {
|
||||
class A {};
|
||||
class B : public virtual A {};
|
||||
class C : public virtual A {};
|
||||
class D : protected B, private C {};
|
||||
}
|
||||
|
||||
namespace UdtKindTest {
|
||||
struct A {};
|
||||
class B {};
|
||||
union C {};
|
||||
}
|
||||
|
||||
namespace BitFieldTest {
|
||||
struct A {
|
||||
int Bits1 : 1;
|
||||
int Bits2 : 2;
|
||||
int Bits3 : 3;
|
||||
int Bits4 : 4;
|
||||
int Bits22 : 22;
|
||||
int Offset0x04;
|
||||
};
|
||||
};
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
MembersTest::A v1;
|
||||
v1.MemberFunc();
|
||||
BaseClassTest::D v2;
|
||||
UdtKindTest::A v3;
|
||||
UdtKindTest::B v4;
|
||||
UdtKindTest::C v5;
|
||||
BitFieldTest::A v7;
|
||||
return 0;
|
||||
}
|
Binary file not shown.
@ -1,48 +0,0 @@
|
||||
// Compile with "cl /c /Zi /GR- ComplexPaddingTest.cpp"
|
||||
// Link with "link ComplexPaddingTest.obj /debug /nodefaultlib /entry:main"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C" using at_exit_handler = void();
|
||||
|
||||
int atexit(at_exit_handler handler) { return 0; }
|
||||
|
||||
struct TestVB {
|
||||
static void operator delete(void *ptr, size_t sz) {}
|
||||
virtual ~TestVB() {}
|
||||
virtual void IntroFunction1() {}
|
||||
int X;
|
||||
} A;
|
||||
|
||||
struct TestNVB {
|
||||
static void operator delete(void *ptr, size_t sz) {}
|
||||
virtual ~TestNVB() {}
|
||||
virtual void IntroFunction2() {}
|
||||
int Y;
|
||||
} B;
|
||||
|
||||
struct TestVBLayout
|
||||
: public virtual TestVB,
|
||||
public TestNVB {
|
||||
static void operator delete(void *ptr, size_t sz) {}
|
||||
int Z;
|
||||
} C;
|
||||
|
||||
struct TestIVBBase : public virtual TestVB {
|
||||
int A;
|
||||
} D;
|
||||
|
||||
struct TestIVBDerived : public TestIVBBase {
|
||||
int B;
|
||||
} E;
|
||||
|
||||
struct TestIVBMergedDerived
|
||||
: public virtual TestVB,
|
||||
public TestIVBBase {
|
||||
int B;
|
||||
} F;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
return 0;
|
||||
}
|
@ -1 +0,0 @@
|
||||
093276bb70816a200b7b7bfe6aa00a3ffc790c22
|
@ -1,47 +0,0 @@
|
||||
// Compile with "cl /c /Zi /GR- FilterTest.cpp"
|
||||
// Link with "link FilterTest.obj /debug /nodefaultlib /entry:main"
|
||||
|
||||
class FilterTestClass {
|
||||
public:
|
||||
typedef int NestedTypedef;
|
||||
enum NestedEnum {
|
||||
NestedEnumValue1
|
||||
};
|
||||
|
||||
void MemberFunc() {}
|
||||
|
||||
int foo() const { return IntMemberVar; }
|
||||
|
||||
private:
|
||||
int IntMemberVar;
|
||||
double DoubleMemberVar;
|
||||
};
|
||||
|
||||
int IntGlobalVar;
|
||||
double DoubleGlobalVar;
|
||||
typedef int GlobalTypedef;
|
||||
char OneByte;
|
||||
char TwoBytes[2];
|
||||
char ThreeBytes[3];
|
||||
|
||||
enum GlobalEnum {
|
||||
GlobalEnumVal1
|
||||
} GlobalEnumVar;
|
||||
|
||||
int CFunc() {
|
||||
return (int)OneByte * 2;
|
||||
}
|
||||
int BFunc() {
|
||||
return 42;
|
||||
}
|
||||
int AFunc() {
|
||||
static FilterTestClass FC;
|
||||
|
||||
return (CFunc() + BFunc()) * IntGlobalVar + FC.foo();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
FilterTestClass TestClass;
|
||||
GlobalTypedef v1;
|
||||
return 0;
|
||||
}
|
Binary file not shown.
@ -1,6 +0,0 @@
|
||||
// Compile with "cl /c /Zi /GR- LoadAddressTest.cpp"
|
||||
// Link with "link LoadAddressTest.obj /debug /nodefaultlib /entry:main"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
return 0;
|
||||
}
|
@ -1 +0,0 @@
|
||||
e302e9bf3b61f436b429a74e81bdd5bda916ca61
|
@ -1,168 +0,0 @@
|
||||
// Compile with "cl /c /Zi /GR- SimplePaddingTest.cpp"
|
||||
// Link with "link SimplePaddingTest.obj /debug /nodefaultlib /entry:main"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C" using at_exit_handler = void();
|
||||
|
||||
int atexit(at_exit_handler handler) { return 0; }
|
||||
|
||||
struct SimplePadNoPadding {
|
||||
int32_t X;
|
||||
int32_t Y;
|
||||
// No padding anywhere, sizeof(T) = 8
|
||||
} A;
|
||||
|
||||
struct SimplePadUnion {
|
||||
union {
|
||||
int32_t X;
|
||||
int64_t Y;
|
||||
struct {
|
||||
int32_t X;
|
||||
// 4 bytes of padding here
|
||||
int64_t Y;
|
||||
} Z;
|
||||
};
|
||||
// Since the padding occurs at a location that is occupied by other storage
|
||||
// (namely the Y member), the storage will still be considered used, and so
|
||||
// there will be no unused bytes in the larger class. But in the debug
|
||||
// info for the nested struct, we should see padding.
|
||||
// sizeof(SimplePadUnion) == sizeof(Z) == 16
|
||||
} B;
|
||||
|
||||
struct SimplePadNoPadding2 {
|
||||
bool A;
|
||||
bool B;
|
||||
bool C;
|
||||
bool D;
|
||||
// No padding anywhere, sizeof(T) = 4
|
||||
} C;
|
||||
|
||||
struct alignas(4) SimplePadFields1 {
|
||||
char A;
|
||||
char B;
|
||||
char C;
|
||||
// 1 byte of padding here, sizeof(T) = 4
|
||||
} E;
|
||||
|
||||
struct SimplePadFields2 {
|
||||
int32_t Y;
|
||||
char X;
|
||||
} F;
|
||||
|
||||
struct SimplePadBase {
|
||||
// Make sure this class is 4 bytes, and the derived class requires 8 byte
|
||||
// alignment, so that padding is inserted between base and derived.
|
||||
int32_t X;
|
||||
// No padding here
|
||||
} G;
|
||||
|
||||
struct SimplePadDerived : public SimplePadBase {
|
||||
// 4 bytes of padding here due to Y requiring 8 byte alignment.
|
||||
// Thus, sizeof(T) = 16
|
||||
int64_t Y;
|
||||
} H;
|
||||
|
||||
struct SimplePadEmptyBase1 {};
|
||||
struct SimplePadEmptyBase2 {};
|
||||
|
||||
struct SimplePadEmpty : public SimplePadEmptyBase1, SimplePadEmptyBase2 {
|
||||
// Bases have to occupy at least 1 byte of storage, so this requires
|
||||
// 2 bytes of padding, plus 1 byte for each base, yielding sizeof(T) = 8
|
||||
int32_t X;
|
||||
} I;
|
||||
|
||||
struct SimplePadVfptr {
|
||||
virtual ~SimplePadVfptr() {}
|
||||
static void operator delete(void *ptr, size_t sz) {}
|
||||
int32_t X;
|
||||
} J;
|
||||
|
||||
struct NonEmptyBase1 {
|
||||
bool X;
|
||||
};
|
||||
|
||||
struct NonEmptyBase2 {
|
||||
bool Y;
|
||||
};
|
||||
|
||||
struct SimplePadMultiInherit : public NonEmptyBase1, public NonEmptyBase2 {
|
||||
// X and Y from the 2 bases will get squished together, leaving 2 bytes
|
||||
// of padding necessary for proper alignment of an int32.
|
||||
// Therefore, sizeof(T) = 2 + 2 + 4 = 8
|
||||
int32_t X;
|
||||
} K;
|
||||
|
||||
struct SimplePadMultiInherit2 : public SimplePadFields1, SimplePadFields2 {
|
||||
// There should be 1 byte of padding after the first class, and
|
||||
// 3 bytes of padding after the second class.
|
||||
int32_t X;
|
||||
} L;
|
||||
|
||||
struct OneLevelInherit : public NonEmptyBase1 {
|
||||
short Y;
|
||||
};
|
||||
|
||||
struct SimplePadTwoLevelInherit : public OneLevelInherit {
|
||||
// OneLevelInherit has nested padding because of its base,
|
||||
// and then padding again because of this class. So each
|
||||
// class should be 4 bytes, yielding sizeof(T) = 12.
|
||||
int64_t Z;
|
||||
} M;
|
||||
|
||||
struct SimplePadAggregate {
|
||||
NonEmptyBase1 X;
|
||||
int32_t Y;
|
||||
// the presence of X will cause 3 bytes of padding to be injected.
|
||||
SimplePadFields1 Fields;
|
||||
} N;
|
||||
|
||||
struct SimplePadVtable1 {
|
||||
static void operator delete(void *ptr, size_t sz) {}
|
||||
virtual ~SimplePadVtable1() {}
|
||||
virtual void A1() {}
|
||||
virtual void B1() {}
|
||||
} O;
|
||||
|
||||
struct SimplePadVtable2 {
|
||||
static void operator delete(void *ptr, size_t sz) {}
|
||||
virtual ~SimplePadVtable2() {}
|
||||
virtual void X2() {}
|
||||
virtual void Y2() {}
|
||||
virtual void Z2() {}
|
||||
} P;
|
||||
|
||||
struct SimplePadVtable3 {
|
||||
static void operator delete(void *ptr, size_t sz) {}
|
||||
virtual ~SimplePadVtable3() {}
|
||||
virtual void Foo3() {}
|
||||
virtual void Bar3() {}
|
||||
virtual void Baz3() {}
|
||||
virtual void Buzz3() {}
|
||||
} Q;
|
||||
|
||||
struct SimplePadMultiVTables
|
||||
: public SimplePadVtable1,
|
||||
public SimplePadVtable2,
|
||||
public SimplePadVtable3 {
|
||||
|
||||
~SimplePadMultiVTables() override {}
|
||||
static void operator delete(void *ptr, size_t sz) {}
|
||||
|
||||
// SimplePadVtable1 overrides
|
||||
void A1() override {}
|
||||
|
||||
// SimplePadVtable2 overrides
|
||||
void Y2() override {}
|
||||
void Z2() override {}
|
||||
|
||||
// SimplePadVtable3 overrides
|
||||
void Bar3() override {}
|
||||
void Baz3() override {}
|
||||
void Buzz3() override {}
|
||||
} R;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
return 0;
|
||||
}
|
@ -1 +0,0 @@
|
||||
f19c00660a73bc4a09deacfe9499c4dbb9388ff8
|
Reference in New Issue
Block a user