1 /* { dg-do run } */ 2 /* { dg-options "-ftree-parallelize-loops=4 -O2 -ffast-math" } */ 3 4 extern void abort (void); 5 6 double d[1024], e[1024]; 7 int f[1024], g[1024]; 8 9 double __attribute__((noinline)) foo(void)10foo (void) 11 { 12 double s = 0.0; 13 int i; 14 for (i = 0; i < 1024; i++) 15 s += d[i] - e[i]; 16 return s; 17 } 18 19 int __attribute__((noinline)) bar(void)20bar (void) 21 { 22 int s = 0, i; 23 for (i = 0; i < 1024; i++) 24 s += f[i] - g[i]; 25 return s; 26 } 27 28 int main(void)29main (void) 30 { 31 int i; 32 for (i = 0; i < 1024; i++) 33 { 34 d[i] = i * 2; 35 e[i] = i; 36 f[i] = i * 2; 37 g[i] = i; 38 } 39 if (foo () != 1023 * 1024 / 2) 40 abort (); 41 if (bar () != 1023 * 1024 / 2) 42 abort (); 43 return 0; 44 } 45