1 // PR middle-end/29965
2 // Test that OpenMP construct bodies which never return don't cause ICEs.
3 // { dg-do compile }
4 // { dg-options "-O2 -fopenmp" }
5 
6 extern void baz () __attribute__ ((noreturn));
7 
8 void
foo1()9 foo1 ()
10 {
11 #pragma omp single
12   for (;;);
13 }
14 
15 void
bar1()16 bar1 ()
17 {
18 #pragma omp single
19   baz ();
20 }
21 
22 void
foo2()23 foo2 ()
24 {
25 #pragma omp master
26   for (;;);
27 }
28 
29 void
bar2()30 bar2 ()
31 {
32 #pragma omp master
33   baz ();
34 }
35 
36 void
foo3()37 foo3 ()
38 {
39 #pragma omp ordered
40   for (;;);
41 }
42 
43 void
bar3()44 bar3 ()
45 {
46 #pragma omp ordered
47   baz ();
48 }
49 
50 void
foo4()51 foo4 ()
52 {
53 #pragma omp critical
54   for (;;);
55 }
56 
57 void
bar4()58 bar4 ()
59 {
60 #pragma omp critical
61   baz ();
62 }
63