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