(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.c/
copyin-2.c
       1  /* { dg-do run } */
       2  /* { dg-require-effective-target tls_runtime } */
       3  
       4  #include <omp.h>
       5  #include <stdlib.h>
       6  
       7  struct { int t; char buf[64]; } thr = { 32, "" };
       8  #pragma omp threadprivate (thr)
       9  
      10  int
      11  main (void)
      12  {
      13    int l = 0;
      14  
      15    omp_set_dynamic (0);
      16    omp_set_num_threads (6);
      17  
      18  #pragma omp parallel copyin (thr) reduction (||:l)
      19    {
      20      l = thr.t != 32;
      21      thr.t = omp_get_thread_num () + 11;
      22    }
      23  
      24    if (l || thr.t != 11)
      25      abort ();
      26  
      27  #pragma omp parallel reduction (||:l)
      28    l = thr.t != omp_get_thread_num () + 11;
      29  
      30    if (l)
      31      abort ();
      32    return 0;
      33  }