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 int i; 12 #pragma omp for schedule (dynamic) 13 for (i = 0; i < 2834; i++) 14 for (;;) 15 ; 16 } 17 18 void bar1()19bar1 () 20 { 21 int i; 22 #pragma omp for schedule (dynamic) 23 for (i = 0; i < 2834; i++) 24 baz (); 25 } 26 27 void foo2()28foo2 () 29 { 30 int i; 31 #pragma omp parallel for schedule (dynamic) 32 for (i = 0; i < 2834; i++) 33 for (;;) 34 ; 35 } 36 37 void bar2()38bar2 () 39 { 40 int i; 41 #pragma omp parallel for schedule (dynamic) 42 for (i = 0; i < 2834; i++) 43 baz (); 44 } 45