1  /* PR target/65956 */
       2  
       3  struct A { char *a; int b; long long c; };
       4  char v[3];
       5  
       6  __attribute__((noinline, noclone)) void
       7  fn1 (char *x, char *y)
       8  {
       9    if (x != &v[1] || y != &v[2])
      10      __builtin_abort ();
      11    v[1]++;
      12  }
      13  
      14  __attribute__((noinline, noclone)) int
      15  fn2 (char *x)
      16  {
      17    asm volatile ("" : "+g" (x) : : "memory");
      18    return x == &v[0];
      19  }
      20  
      21  __attribute__((noinline, noclone)) void
      22  fn3 (const char *x)
      23  {
      24    if (x[0] != 0)
      25      __builtin_abort ();
      26  }
      27  
      28  static struct A
      29  foo (const char *x, struct A y, struct A z)
      30  {
      31    struct A r = { 0, 0, 0 };
      32    if (y.b && z.b)
      33      {
      34        if (fn2 (y.a) && fn2 (z.a))
      35  	switch (x[0])
      36  	  {
      37  	  case '|':
      38  	    break;
      39  	  default:
      40  	    fn3 (x);
      41  	  }
      42        fn1 (y.a, z.a);
      43      }
      44    return r;
      45  }
      46  
      47  __attribute__((noinline, noclone)) int
      48  bar (int x, struct A *y)
      49  {
      50    switch (x)
      51      {
      52      case 219:
      53        foo ("+", y[-2], y[0]);
      54      case 220:
      55        foo ("-", y[-2], y[0]);
      56      }
      57  }
      58  
      59  int
      60  main ()
      61  {
      62    struct A a[3] = { { &v[1], 1, 1LL }, { &v[0], 0, 0LL }, { &v[2], 2, 2LL } };
      63    bar (220, a + 2);
      64    if (v[1] != 1)
      65      __builtin_abort ();
      66    return 0;
      67  }