gcc/testsuite/gcc.dg/graphite/isl-ast-gen-single-loop-3.c
raw| 1 | int n = 50; |
| 2 | |
| 3 | void |
| 4 | foo (int a[]) |
| 5 | { |
| 6 | int i; |
| 7 | for (i = 0; i < n; i++) |
| 8 | a[i] = i; |
| 9 | } |
| 10 | |
| 11 | int |
| 12 | array_sum (int a[]) |
| 13 | { |
| 14 | int i; |
| 15 | int res = 0; |
| 16 | for(i = 1; i < n; i *= 2) |
| 17 | res += a[i]; |
| 18 | return res; |
| 19 | } |
| 20 | |
| 21 | extern void abort (); |
| 22 | |
| 23 | int |
| 24 | main (void) |
| 25 | { |
| 26 | int a[50]; |
| 27 | foo (a); |
| 28 | int res = array_sum (a); |
| 29 | if (res != 63) |
| 30 | abort (); |
| 31 | return 0; |
| 32 | } |