summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/appendix-a/a.21.1.c
blob: 0c1c39a1271f43a7b7a6595cc9ec6144b9d6385c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* { dg-do run } */

#include <stdio.h>
void
work (int k)
{
#pragma omp ordered
  printf (" %d\n", k);
}

void
a21 (int lb, int ub, int stride)
{
  int i;
#pragma omp parallel for ordered schedule(dynamic)
  for (i = lb; i < ub; i += stride)
    work (i);
}

int
main ()
{
  a21 (0, 100, 5);
  return 0;
}