Retro68/gcc/libgomp/testsuite/libgomp.c/omp-loop02.c

34 lines
353 B
C
Raw Normal View History

2012-03-27 23:13:14 +00:00
#include <omp.h>
/* Orphaned work sharing. */
extern void abort (void);
#define N 10
void parloop (int *a)
{
int i;
#pragma omp for
for (i = 0; i < N; i++)
a[i] = i + 3;
}
2015-08-28 15:33:40 +00:00
int
2012-03-27 23:13:14 +00:00
main()
{
int i, a[N];
#pragma omp parallel shared(a)
{
parloop (a);
}
for (i = 0; i < N; i++)
if (a[i] != i + 3)
abort ();
return 0;
}