1 /* { dg-do run } */ 2 /* { dg-options "-O2 -fmodulo-sched -funroll-loops -fdump-rtl-sms --param sms-min-sc=1 -fmodulo-sched-allow-regmoves" } */ 3 4 extern void abort (void); 5 6 int X[1000]={0}; 7 int Y[1000]={0}; 8 9 extern void abort (void); 10 11 __attribute__ ((noinline)) 12 int foo(int len,long a)13foo (int len, long a) 14 { 15 int i; 16 long res = a; 17 18 len = 1000; 19 for (i = 0; i < len; i++) 20 res += X[i]* Y[i]; 21 22 if (res != 601) 23 abort (); 24 25 } 26 27 int main()28main () 29 { 30 X[0] = Y[1] = 2; 31 Y[0] = X[1] = 21; 32 X[2] = Y[3] = 3; 33 Y[2] = X[3] = 31; 34 X[4] = Y[5] = 4; 35 Y[4] = X[5] = 41; 36 37 foo (6, 3); 38 return 0; 39 } 40 41 /* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target spu-*-* powerpc*-*-* } } } */ 42 /* { dg-final { cleanup-rtl-dump "sms" } } */ 43 44