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()9foo1 () 10 { 11 #pragma omp sections 12 { 13 for (;;) 14 ; 15 } 16 } 17 18 void bar1()19bar1 () 20 { 21 #pragma omp sections 22 { 23 #pragma omp section 24 baz (); 25 #pragma omp section 26 baz (); 27 } 28 } 29 30 void foo2()31foo2 () 32 { 33 #pragma omp sections 34 { 35 ; 36 #pragma omp section 37 for (;;) 38 ; 39 } 40 } 41 42 void bar2()43bar2 () 44 { 45 #pragma omp sections 46 { 47 #pragma omp section 48 baz (); 49 #pragma omp section 50 ; 51 } 52 } 53 54 void foo3()55foo3 () 56 { 57 #pragma omp parallel sections 58 { 59 for (;;) 60 ; 61 } 62 } 63 64 void bar3()65bar3 () 66 { 67 #pragma omp parallel sections 68 { 69 #pragma omp section 70 baz (); 71 #pragma omp section 72 baz (); 73 } 74 } 75 76 void foo4()77foo4 () 78 { 79 #pragma omp parallel sections 80 { 81 ; 82 #pragma omp section 83 for (;;) 84 ; 85 } 86 } 87 88 void bar4()89bar4 () 90 { 91 #pragma omp parallel sections 92 { 93 #pragma omp section 94 baz (); 95 #pragma omp section 96 ; 97 } 98 } 99