(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.c/
nested-1.c
       1  /* { dg-additional-options "-Wno-deprecated-declarations" } */
       2  
       3  #include <omp.h>
       4  #include <stdlib.h>
       5  
       6  int
       7  main (void)
       8  {
       9    int i = -1, j = -1;
      10  
      11    omp_set_nested (1);
      12    omp_set_dynamic (0);
      13  #pragma omp parallel num_threads (4)
      14    {
      15  #pragma omp single
      16      {
      17        i = omp_get_thread_num () + omp_get_num_threads () * 256;
      18  #pragma omp parallel num_threads (2)
      19        {
      20  #pragma omp single
      21          {
      22            j = omp_get_thread_num () + omp_get_num_threads () * 256;
      23          }
      24        }
      25      }
      26    }
      27    if (i < 4 * 256 || i >= 4 * 256 + 4)
      28      abort ();
      29    if (j < 2 * 256 || j >= 2 * 256 + 2)
      30      abort ();
      31    return 0;
      32  }