| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-ftree-loop-distribution -funswitch-loops" } */ |
| 3 |
|
| 4 |
struct test_struct { |
| 5 |
int a, b[10], c[10], d[10]; |
| 6 |
}; |
| 7 |
|
| 8 |
extern struct test_struct* new_struct; |
| 9 |
|
| 10 |
void testfunc(struct test_struct* old_struct) |
| 11 |
{ |
| 12 |
int i; |
| 13 |
for (i = 0; i < 10; ++i) |
| 14 |
{ |
| 15 |
new_struct->b[i] = old_struct ? old_struct->b[i] : -1; |
| 16 |
new_struct->c[i] = old_struct ? old_struct->c[i] : 0; |
| 17 |
new_struct->d[i] = old_struct ? old_struct->d[i] : 0; |
| 18 |
} |
| 19 |
if (old_struct) |
| 20 |
old_struct->a++; |
| 21 |
} |