1struct Empty {};
2struct EmptyMember {
3 char i[0];
4};
5struct SingleMember {
6 int i;
7};
8
9struct PaddingMember {
10 int i;
11 char c;
12};
13
14const unsigned sizeof_empty = sizeof(struct Empty);
15const unsigned sizeof_empty_member = sizeof(struct EmptyMember);
16const unsigned sizeof_single = sizeof(struct SingleMember);
17const unsigned sizeof_padding = sizeof(struct PaddingMember);
18
19int main() {
20 struct Empty empty;
21 struct EmptyMember empty_member;
22 struct SingleMember single;
23 struct PaddingMember padding;
24 // Make sure globals are used.
25 return sizeof_empty + sizeof_empty_member + sizeof_single + sizeof_padding;
26}
27

source code of lldb/test/API/lang/c/sizeof/main.c