* c-c++-common/Wrestrict.c (test_strcpy_range): Revert latest change.
[official-gcc.git] / libgomp / testsuite / libgomp.c / parloops-exit-first-loop-alt-2.c
bloba3ec7fe8ad0cd26d28805041b4a2734304f102fe
1 /* { dg-do run } */
2 /* { dg-additional-options "-ftree-parallelize-loops=2" } */
4 /* Constant bound, vector addition. */
6 #include <stdio.h>
7 #include <stdlib.h>
9 #define N 1000
11 unsigned int a[N];
12 unsigned int b[N];
13 unsigned int c[N];
15 void __attribute__((noclone,noinline))
16 f (void)
18 int i;
20 for (i = 0; i < N; ++i)
21 c[i] = a[i] + b[i];
24 int
25 main (void)
27 int i, j;
29 /* Complexify loop to inhibit parloops. */
30 for (j = 0; j < 100; ++j)
31 for (i = 0; i < 10; i++)
33 int k = i + (10 * j);
34 a[k] = k;
35 b[k] = (k * 3) % 7;
36 c[k] = k * 2;
39 f ();
41 for (i = 0; i < N; i++)
43 unsigned int actual = c[i];
44 unsigned int expected = i + ((i * 3) % 7);
45 if (actual != expected)
46 abort ();
49 return 0;