00001 /* PR middle-end/32362 */ 00002 /* { dg-do run } */ 00003 /* { dg-options "-O2" } */ 00004 00005 #include <omp.h> 00006 #include <stdlib.h> 00007 00008 int 00009 main () 00010 { 00011 int n[4] = { -1, -1, -1, -1 }; 00012 static int a = 2, b = 4; 00013 omp_set_num_threads (4); 00014 omp_set_dynamic (0); 00015 omp_set_nested (1); 00016 #pragma omp parallel private(b) 00017 { 00018 b = omp_get_thread_num (); 00019 #pragma omp parallel firstprivate(a) 00020 { 00021 a = (omp_get_thread_num () + a) + 1; 00022 if (b == omp_get_thread_num ()) 00023 n[omp_get_thread_num ()] = a + (b << 4); 00024 } 00025 } 00026 if (n[0] != 3) 00027 abort (); 00028 if (n[3] != -1 00029 && (n[1] != 0x14 || n[2] != 0x25 || n[3] != 0x36)) 00030 abort (); 00031 return 0; 00032 }