xref: /openbsd-src/gnu/gcc/libgomp/testsuite/libgomp.c/loop-3.c (revision 404b540a9034ac75a6199ad1a32d1bbc7a0d4210)
1*404b540aSrobert /* { dg-do run } */
2*404b540aSrobert 
3*404b540aSrobert extern void abort (void);
4*404b540aSrobert 
5*404b540aSrobert volatile int count;
test(void)6*404b540aSrobert static int test(void)
7*404b540aSrobert {
8*404b540aSrobert   return ++count > 0;
9*404b540aSrobert }
10*404b540aSrobert 
main()11*404b540aSrobert int main()
12*404b540aSrobert {
13*404b540aSrobert   int i;
14*404b540aSrobert   #pragma omp for
15*404b540aSrobert   for (i = 0; i < 10; ++i)
16*404b540aSrobert     {
17*404b540aSrobert       if (test())
18*404b540aSrobert 	continue;
19*404b540aSrobert       abort ();
20*404b540aSrobert     }
21*404b540aSrobert   if (i != count)
22*404b540aSrobert     abort ();
23*404b540aSrobert   return 0;
24*404b540aSrobert }
25