gcc/testsuite/gcc.c-torture/execute/pr27073.c
raw| 1 | void abort (void); |
| 2 | void exit (int); |
| 3 | |
| 4 | void __attribute__((noinline)) |
| 5 | foo (int *p, int d1, int d2, int d3, |
| 6 | short count, int s1, int s2, int s3, int s4, int s5) |
| 7 | { |
| 8 | int n = count; |
| 9 | while (n--) |
| 10 | { |
| 11 | *p++ = s1; |
| 12 | *p++ = s2; |
| 13 | *p++ = s3; |
| 14 | *p++ = s4; |
| 15 | *p++ = s5; |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | int main() |
| 20 | { |
| 21 | int x[10], i; |
| 22 | |
| 23 | foo (x, 0, 0, 0, 2, 100, 200, 300, 400, 500); |
| 24 | for (i = 0; i < 10; i++) |
| 25 | if (x[i] != (i % 5 + 1) * 100) |
| 26 | abort (); |
| 27 | exit (0); |
| 28 | } |