OSDN Git Service

* gcc.dg/vect/vect-105.c: Prevent compiler from hoisting abort
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / sms-1.c
1 /* The same test as loop-3c.c.  It failed on ia64
2    due to not handling of subreg in the lhs that is fixed.  */
3 /* { dg-do run } */
4 /* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -w" } */
5
6
7 #include <limits.h>
8
9 void * a[255];
10
11 f (m)
12 {
13   int i;
14   int sh = 0x100;
15   i = m;
16   do
17     {
18       a[sh >>= 1] = ((unsigned)i << 3)  + (char*)a;
19       i += 4;
20     }
21   while (i < INT_MAX/2 + 1 + 4 * 4);
22 }
23
24 main ()
25 {
26   a[0x10] = 0;
27   a[0x08] = 0;
28   f (INT_MAX/2 + INT_MAX/4 + 2);
29   if (a[0x10] || a[0x08])
30     abort ();
31   a[0x10] = 0;
32   a[0x08] = 0;
33   f (INT_MAX/2 + 1);
34   if (! a[0x10] || a[0x08])
35     abort ();
36   exit (0);
37 }
38