isel1.ssa (535B)
1 # tests that the address matcher is not 2 # confused by the two multiplications 3 4 # note: the code handling apple asm fixes 5 # ruins the good work of the matcher here, 6 # I should revisit these fixes 7 8 export function w $f(l %i, l %j) { 9 @start 10 %off1 =l mul %i, 8 11 %a_i =l add $a, %off1 12 %off2 =l mul %j, 4 13 %a_ij =l add %a_i, %off2 14 %x =w loadsw %a_ij 15 ret %x 16 } 17 18 # >>> driver 19 # int a[] = {1, 2, 3, 4}; 20 # extern int f(long long, long long); 21 # int main() { 22 # return !(f(0, 0) == 1 && f(0, 1) == 2 && f(1, 0) == 3 && f(1, 1) == 4); 23 # } 24 # <<<