1 /* PR middle-end/70680 */ 2 3 int v; 4 5 void f1(void)6f1 (void) 7 { 8 int i = 0, j = 0; 9 #pragma omp task default(shared) if(0) 10 { 11 #pragma omp simd collapse(2) 12 for (i = 0; i < 10; i++) 13 for (j = 0; j < 10; j++) 14 ; 15 v = i + j; 16 } 17 if (i != 10 || j != 10) 18 __builtin_abort (); 19 } 20 21 void f2(void)22f2 (void) 23 { 24 int i = 0, j = 0; 25 #pragma omp task default(shared) if(0) 26 { 27 #pragma omp simd collapse(2) 28 for (i = 0; i < 10; i++) 29 for (j = 0; j < 10; j++) 30 ; 31 } 32 if (i != 10 || j != 10) 33 __builtin_abort (); 34 } 35 36 void f3(void)37f3 (void) 38 { 39 int i = 0, j = 0; 40 #pragma omp task default(shared) if(0) 41 { 42 #pragma omp simd collapse(2) lastprivate (i, j) 43 for (i = 0; i < 10; i++) 44 for (j = 0; j < 10; j++) 45 ; 46 v = i + j; 47 } 48 if (i != 10 || j != 10) 49 __builtin_abort (); 50 } 51 52 void f4(void)53f4 (void) 54 { 55 int i = 0, j = 0; 56 #pragma omp task default(shared) if(0) 57 { 58 #pragma omp simd collapse(2) lastprivate (i, j) 59 for (i = 0; i < 10; i++) 60 for (j = 0; j < 10; j++) 61 ; 62 } 63 if (i != 10 || j != 10) 64 __builtin_abort (); 65 } 66 67 int main()68main () 69 { 70 f1 (); 71 if (v++ != 20) 72 __builtin_abort (); 73 f2 (); 74 f3 (); 75 if (v++ != 20) 76 __builtin_abort (); 77 f4 (); 78 return 0; 79 } 80