Daily bump.
[official-gcc.git] / libgomp / testsuite / libgomp.c / parloops-exit-first-loop-alt-3.c
blob78365e868c173c8e75f2f7550aa9d1c25d731f2a
1 /* { dg-do run } */
2 /* { dg-additional-options "-ftree-parallelize-loops=2" } */
4 /* Variable bound, reduction. */
6 #include <stdlib.h>
8 #define N 4000
10 unsigned int *a;
12 unsigned int __attribute__((noclone,noinline))
13 f (unsigned int n, unsigned int *__restrict__ a)
15 int i;
16 unsigned int sum = 1;
18 for (i = 0; i < n; ++i)
19 sum += a[i];
21 return sum;
24 int
25 main (void)
27 unsigned int res;
28 unsigned int array[N];
29 int i;
31 for (i = 0; i < N; ++i)
32 array[i] = i % 7;
33 a = &array[0];
35 res = f (N, a);
36 if (res != 11995)
37 abort ();
39 /* Test low iteration count case. */
40 res = f (10, a);
41 if (res != 25)
42 abort ();
44 return 0;