[InstCombine][NFC] Precommit a test for folding a binary op of reductions. (#121568)
[llvm-project.git] / lldb / test / API / lang / cpp / sizeof / main.cpp
blob4a7a89a1307fd3b6bce20e46fdb2c075c544d3e1
1 struct Empty {};
2 class EmptyClass {};
3 class alignas(4) EmptyClassAligned {};
4 class ClassEmptyMember {
5 int i[0];
6 };
8 struct SingleMember {
9 int i;
11 class SingleMemberClass {
12 int i;
15 struct PaddingMember {
16 int i;
17 char c;
19 class PaddingMemberClass {
20 int i;
21 char c;
24 const unsigned sizeof_empty = sizeof(Empty);
25 const unsigned sizeof_empty_class = sizeof(EmptyClass);
26 const unsigned sizeof_empty_class_aligned = sizeof(EmptyClassAligned);
27 const unsigned sizeof_class_empty_member = sizeof(ClassEmptyMember);
28 const unsigned sizeof_single = sizeof(SingleMember);
29 const unsigned sizeof_single_class = sizeof(SingleMemberClass);
30 const unsigned sizeof_padding = sizeof(PaddingMember);
31 const unsigned sizeof_padding_class = sizeof(PaddingMemberClass);
33 int main() {
34 Empty empty;
35 EmptyClass empty_class;
36 EmptyClassAligned empty_class_aligned;
37 ClassEmptyMember class_empty_member;
38 SingleMember single;
39 SingleMemberClass single_class;
40 PaddingMember padding;
41 PaddingMemberClass padding_class;
42 // Make sure globals are used.
43 return sizeof_empty + sizeof_empty_class + sizeof_class_empty_member +
44 sizeof_single + +sizeof_empty_class_aligned + sizeof_single_class +
45 sizeof_padding + sizeof_padding_class;