(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
gomp/
pr103642.c
       1  /* PR middle-end/103642 */
       2  /* { dg-do compile } */
       3  
       4  #include <stdlib.h>
       5  
       6  typedef struct
       7  {
       8    int *a;
       9  } S;
      10  
      11  typedef struct
      12  {
      13    S *s;
      14    int *ptr;
      15  } T;
      16  
      17  #define N 10
      18  
      19  int main (void)
      20  {
      21    T t;
      22    t.s = (S *) malloc (sizeof (S));
      23    t.s->a = (int *) malloc (sizeof(int) * N);
      24  
      25    #pragma omp target map(from: t.s->a[:N])
      26    {
      27      t.s->a[0] = 1;
      28    }
      29  
      30    free (t.s->a);
      31    free (t.s);
      32  
      33    return 0;
      34  }