37-struct-store.c (532B)
1 // tests/cc-parse/37-struct-store.c — struct member store via real C 2 // (§D.2 of docs/CC-PUNCHLIST.md). char-typed fields exercise the 3 // width-correct store path; distinct multipliers in the readback 4 // isolate each field, so any offset/width bug yields a wrong sum. 5 // 6 // b.a=3; b.b=5; b.c=7; return (b.a + b.b*10 + b.c*100) == 753; -> 1. 7 8 int main() { 9 struct B { unsigned char a; unsigned char b; unsigned char c; }; 10 struct B b; 11 b.a = 3; 12 b.b = 5; 13 b.c = 7; 14 return (b.a + b.b * 10 + b.c * 100) == 753; 15 }