(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.oacc-c-c++-common/
deep-copy-2.c
       1  #include <assert.h>
       2  #include <stdlib.h>
       3  
       4  int
       5  main(int argc, char* argv[])
       6  {
       7    struct foo {
       8      int *a, *b, c, d, *e;
       9    } s;
      10  
      11    s.a = (int *) malloc (16 * sizeof (int));
      12    s.b = (int *) malloc (16 * sizeof (int));
      13    s.e = (int *) malloc (16 * sizeof (int));
      14  
      15    #pragma acc data copy(s)
      16    {
      17      #pragma acc data copy(s.a[0:10])
      18      {
      19        #pragma acc parallel loop attach(s.a)
      20        for (int i = 0; i < 10; i++)
      21  	s.a[i] = i;
      22      }
      23    }
      24  
      25    for (int i = 0; i < 10; i++)
      26      assert (s.a[i] == i);
      27  
      28    return 0;
      29  }