(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.oacc-c-c++-common/
deep-copy-1.c
       1  #include <stdlib.h>
       2  #include <assert.h>
       3  
       4  struct dc
       5  {
       6    int a;
       7    int *b;
       8  };
       9  
      10  int
      11  main ()
      12  {
      13    int n = 100, i;
      14    struct dc v = { .a = 3, .b = (int *) malloc (sizeof (int) * n) };
      15  
      16  #pragma acc parallel loop copy(v.a, v.b[:n])
      17    for (i = 0; i < n; i++)
      18      v.b[i] = v.a;
      19  
      20    for (i = 0; i < 10; i++)
      21      assert (v.b[i] == v.a);
      22  
      23    return 0;
      24  }