mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-11 03:52:59 +00:00
28 lines
433 B
C
28 lines
433 B
C
extern void abort (void);
|
|
|
|
int buf[256];
|
|
|
|
void __attribute__((noinline))
|
|
foo (void)
|
|
{
|
|
int i;
|
|
#pragma omp for schedule (auto)
|
|
for (i = 0; i < 256; i++)
|
|
buf[i] += i;
|
|
}
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
int i;
|
|
#pragma omp parallel for schedule (auto)
|
|
for (i = 0; i < 256; i++)
|
|
buf[i] = i;
|
|
#pragma omp parallel num_threads (4)
|
|
foo ();
|
|
for (i = 0; i < 256; i++)
|
|
if (buf[i] != 2 * i)
|
|
abort ();
|
|
return 0;
|
|
}
|