2018-11-28 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / sms-1.c
blob497fe0f1e4207f3b832632509c285675bdb84394
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 -fdump-rtl-sms" } */
7 #include <limits.h>
8 extern void abort (void);
10 void * a[255];
12 __attribute__ ((noinline))
13 void
14 f (int m)
16 int i;
17 int sh = 0x100;
18 i = m;
21 a[sh >>= 1] = ((unsigned)i << 3) + (char*)a;
22 i += 4;
24 while (i < INT_MAX/2 + 1 + 4 * 4);
27 int
28 main ()
30 a[0x10] = 0;
31 a[0x08] = 0;
32 f (INT_MAX/2 + INT_MAX/4 + 2);
33 if (a[0x10] || a[0x08])
34 abort ();
35 a[0x10] = 0;
36 a[0x08] = 0;
37 f (INT_MAX/2 + 1);
38 if (! a[0x10] || a[0x08])
39 abort ();
40 return 0;
43 /* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target powerpc*-*-* spu-*-* } } } */