IVOPT performance tuning patch. The main problem is a variant of maximal weight
[official-gcc.git] / gcc / testsuite / gcc.dg / sms-7.c
blob29791ff2a4fd6c4fc214c2663f319f2cdcaf53f8
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fmodulo-sched -fstrict-aliasing -fdump-rtl-sms" } */
4 extern void abort (void);
6 __attribute__ ((noinline))
7 void foo (int * __restrict__ a, int * __restrict__ b, short * c)
9 int i;
10 for(i = 0; i < 100; i+=4)
12 a[i] = b[i] * c[i];
13 a[i+1] = b[i+1] * c[i+1];
14 a[i+2] = b[i+2] * c[i+2];
15 a[i+3] = b[i+3] * c[i+3];
19 int a[100], b[100];
20 short c[100];
22 int main()
24 #if (__SIZEOF_INT__ <= 2)
25 int i;
26 long res;
27 #else
28 int i, res;
29 #endif
30 for(i = 0; i < 100; i++)
32 b[i] = c[i] = i;
34 foo(a, b, c);
36 res = 0;
37 for(i = 0; i < 100; i++)
39 res += a[i];
41 if(res != 328350)
42 abort();
44 return 0;
47 /* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target spu-*-* } } } */
48 /* { dg-final { scan-rtl-dump-times "SMS succeeded" 3 "sms" { target powerpc*-*-* } } } */
49 /* { dg-final { cleanup-rtl-dump "sms" } } */