qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

abi7.ssa (361B)


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