summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/pr34610.c
blob: 85db164b529a8b5b7621f50689aa65c33fb7533d (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
26
27
28
/* PR gcov-profile/34610 */
/* { dg-do compile } */
/* { dg-options "-O2 -fprofile-arcs -fopenmp" } */

extern void bar (int);
extern void baz (int) __attribute__((noreturn));

void
foo (int k)
{
  int i;
#pragma omp for schedule(dynamic)
  for (i = 0; i < 10; ++i)
    bar (i);
#pragma omp parallel for schedule(static)
  for (i = 0; i < 10; ++i)
    bar (i);
#pragma omp parallel for schedule(static, 4)
  for (i = 0; i < 10; ++i)
    bar (i);
  if (k)
  #pragma omp for schedule(dynamic)
    for (i = 0; i < 10; ++i)
      baz (i);
#pragma omp parallel
  for (i = 0; i < 10; ++i)
    bar (i);
}