(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
torture/
pr56965-1.c
       1  /* { dg-do run } */
       2  /* { dg-options "-fschedule-insns" { target scheduling } } */
       3  
       4  extern void abort (void);
       5  
       6  struct S {
       7      int i;
       8      int j;
       9  };
      10  
      11  struct U {
      12      struct S s;
      13  } __attribute__((may_alias));
      14  
      15  int __attribute__((noinline,noclone))
      16  foo (struct U *p, struct U *q)
      17  {
      18    int i;
      19    q->s.j = 1;
      20    i = p->s.i;
      21    return i;
      22  }
      23  
      24  int main()
      25  {
      26    int a[3];
      27    int *p = a;
      28    p[1] = 0;
      29    if (foo ((struct U *)(p + 1), (struct U *)p) != 1)
      30      abort ();
      31    return 0;
      32  }