PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / sms-5.c
blob09213cc25e0e023bd51ed6bcdc3d3a8f59b1ad4f
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -funroll-loops -fdump-rtl-sms --param sms-min-sc=1" } */
3 /* This is the same test as loop-2e.c test. It is related to a fix in
4 the generation of the prolog and epilog. */
6 extern void abort (void);
8 __attribute__ ((noinline))
9 void f (int *p, int **q)
11 int i;
12 for (i = 0; i < 40; i++)
14 *q++ = &p[i];
18 int main ()
20 void *p;
21 int *q[40];
22 __SIZE_TYPE__ start;
24 /* Find the signed middle of the address space. */
25 if (sizeof(start) == sizeof(int))
26 start = (__SIZE_TYPE__) __INT_MAX__;
27 else if (sizeof(start) == sizeof(long))
28 start = (__SIZE_TYPE__) __LONG_MAX__;
29 else if (sizeof(start) == sizeof(long long))
30 start = (__SIZE_TYPE__) __LONG_LONG_MAX__;
31 else
32 return 0;
34 /* Arbitrarily align the pointer. */
35 start &= -32;
37 /* Pretend that's good enough to start address arithmetic. */
38 p = (void *)start;
40 /* Verify that GIV replacement computes the correct results. */
41 q[39] = 0;
42 f (p, q);
43 if (q[39] != (int *)p + 39)
44 abort ();
46 return 0;
49 /* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target spu-*-* } } } */