abi7.ssa 361 B

123456789101112131415161718192021
  1. # test padding calculation with
  2. # embedded struct
  3. type :s1 = align 4 { w 3 }
  4. type :s2 = align 4 { b 1, :s1 1 }
  5. export function :s2 $test() {
  6. @start
  7. ret $s
  8. }
  9. # >>> driver
  10. # struct s2 {
  11. # char x;
  12. # struct { int a[3]; } s1;
  13. # } s = { .x = 123 };
  14. # extern struct s2 test(void);
  15. # int main(void) {
  16. # return !(test().x == 123);
  17. # }
  18. # <<<