summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/pr29965-4.C
blob: b044fdf70c7b015e52cf23a4470660d13be51f55 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// PR middle-end/29965
// Test that OpenMP construct bodies which never return don't cause ICEs.
// { dg-do compile }
// { dg-options "-O2 -fopenmp" }

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

void
foo1 ()
{
  int i;
#pragma omp for schedule (dynamic)
  for (i = 0; i < 2834; i++)
    for (;;)
      ;
}

void
bar1 ()
{
  int i;
#pragma omp for schedule (dynamic)
  for (i = 0; i < 2834; i++)
    baz ();
}

void
foo2 ()
{
  int i;
#pragma omp parallel for schedule (dynamic)
  for (i = 0; i < 2834; i++)
    for (;;)
      ;
}

void
bar2 ()
{
  int i;
#pragma omp parallel for schedule (dynamic)
  for (i = 0; i < 2834; i++)
    baz ();
}