1 # Simple test for addressing modes.
4 function w $sum(l %arr, w %num) {
7 %n1 =w phi @start %num, @loop1 %n2
8 %s0 =w phi @start 0, @loop1 %s1
15 %idx2 =l add %idx1, %arr
24 # extern int sum(int *, int);
25 # int arr[] = { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 };
26 # #define N sizeof arr / sizeof arr[0]
29 # for (s=i=0; i<N; i++) s+=arr[i];
30 # return !(sum(arr, N) == s);