Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / gcc4 / gcc / testsuite / gcc.c-torture / execute / loop-ivopts-3.c
blob6594da2d95391e1920387eeedea9000cabf09829
1 /* Test for a bug in 4.1 ivcanon code. The loop ends up with two IV, both
2 with a base of &num[1]. In the provess of converting the < condition to =
3 we calculate (base1 - 1) - base0, which overflows and gives 0xffffffffu
4 leading to a bogus loop iteration count. */
5 #include <stdlib.h>
7 struct f
9 int initial_offset;
10 int can_eliminate;
11 int can_eliminate_prev;
15 struct f num[2] = {{1, 3, 5}, {30, 50, 70}};
16 int x = 0;
18 int main()
20 struct f *p;
21 for (p = num; p < &num[1]; p++)
23 x += p->can_eliminate;
25 if (x != 3)
26 abort();
27 exit (0);