<commit_before>// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify 

#define SA(n, p) int a##n[(p) ? 1 : -1]

namespace Test0 {

struct A { int a; };
SA(0, sizeof(A) == 4);

struct B { };
SA(1, sizeof(B) == 1);

struct C : A, B { };
SA(2, sizeof(C) == 4);

struct D { };
struct E : D { };
struct F : E { };

struct G : E, F { };
SA(3, sizeof(G) == 2);

struct Empty { Empty(); };

struct I : Empty { 
  Empty e;
};
SA(4, sizeof(I) == 2);

struct J : Empty { 
  Empty e[2];
};
SA(5, sizeof(J) == 3);

template<int N> struct Derived : Empty, Derived<N - 1> { 
};
template<> struct Derived<0> : Empty { };

struct S1 : virtual Derived<10> { 
  Empty e;
};
SA(6, sizeof(S1) == 24);

struct S2 : virtual Derived<10> { 
  Empty e[2];
};
SA(7, sizeof(S2) == 24);

struct S3 {
  Empty e;
};

struct S4 : Empty, S3 { 
};
SA(8, sizeof(S4) == 2);

struct S5 : S3, Empty {};
SA(9, sizeof(S5) == 2);

struct S6 : S5 { };
SA(10, sizeof(S6) == 2);

struct S7 : Empty {
  void *v;
};
SA(11, sizeof(S7) == 8);

struct S8 : Empty, A {
};
SA(12, sizeof(S8) == 4);

}

namespace Test1 {

// Test that we don't try to place both A subobjects at offset 0.
struct A { };
class B { virtual void f(); };
class C : A, virtual B { };
struct D : virtual C { };
struct E : virtual A { };
class F : D, E { };

SA(0, sizeof(F) == 24);

}

namespace Test2 {

// Test that B::a isn't laid out at offset 0.
struct Empty { };
struct A : Empty { };
struct B : Empty {
  A a;
};

SA(0, sizeof(B) == 2);

}

namespace Test3 {

// Test that B::a isn't laid out at offset 0.
struct Empty { };
struct A { Empty e; };
struct B : Empty {
  A a;
};

SA(0, sizeof(B) == 2);

}<commit_msg>Another empty class layout test.<commit_after>// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify 

#define SA(n, p) int a##n[(p) ? 1 : -1]

namespace Test0 {

struct A { int a; };
SA(0, sizeof(A) == 4);

struct B { };
SA(1, sizeof(B) == 1);

struct C : A, B { };
SA(2, sizeof(C) == 4);

struct D { };
struct E : D { };
struct F : E { };

struct G : E, F { };
SA(3, sizeof(G) == 2);

struct Empty { Empty(); };

struct I : Empty { 
  Empty e;
};
SA(4, sizeof(I) == 2);

struct J : Empty { 
  Empty e[2];
};
SA(5, sizeof(J) == 3);

template<int N> struct Derived : Empty, Derived<N - 1> { 
};
template<> struct Derived<0> : Empty { };

struct S1 : virtual Derived<10> { 
  Empty e;
};
SA(6, sizeof(S1) == 24);

struct S2 : virtual Derived<10> { 
  Empty e[2];
};
SA(7, sizeof(S2) == 24);

struct S3 {
  Empty e;
};

struct S4 : Empty, S3 { 
};
SA(8, sizeof(S4) == 2);

struct S5 : S3, Empty {};
SA(9, sizeof(S5) == 2);

struct S6 : S5 { };
SA(10, sizeof(S6) == 2);

struct S7 : Empty {
  void *v;
};
SA(11, sizeof(S7) == 8);

struct S8 : Empty, A {
};
SA(12, sizeof(S8) == 4);

}

namespace Test1 {

// Test that we don't try to place both A subobjects at offset 0.
struct A { };
class B { virtual void f(); };
class C : A, virtual B { };
struct D : virtual C { };
struct E : virtual A { };
class F : D, E { };

SA(0, sizeof(F) == 24);

}

namespace Test2 {

// Test that B::a isn't laid out at offset 0.
struct Empty { };
struct A : Empty { };
struct B : Empty {
  A a;
};

SA(0, sizeof(B) == 2);

}

namespace Test3 {

// Test that B::a isn't laid out at offset 0.
struct Empty { };
struct A { Empty e; };
struct B : Empty { A a; };
SA(0, sizeof(B) == 2);

}

namespace Test4 {

// Test that C::Empty isn't laid out at offset 0.
struct Empty { };
struct A : Empty { };
struct B { A a; };
struct C : B, Empty { };
SA(0, sizeof(C) == 2);

}
{'fraction_non_alphanumeric': 0.20153061224489796, 'fraction_numerical': 0.045351473922902494, 'mean_word_length': 2.992081447963801, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '912253', 'n_tokens_mistral': 1592, 'n_tokens_neox': 1461, 'n_words': 489}