modernc.org/ccgo/v3@v3.16.14/lib/testdata/gcc-9.1.0/gcc/testsuite/gcc.c-torture/execute/pr88714.c (about)

     1  /* PR bootstrap/88714 */
     2  
     3  struct S { int a, b, c; int *d; };
     4  struct T { int *e, *f, *g; } *t = 0;
     5  int *o = 0;
     6  
     7  __attribute__((noipa))
     8  void bar (int *x, int y, int z, int w)
     9  {
    10    if (w == -1)
    11      {
    12        if (x != 0 || y != 0 || z != 0)
    13  	__builtin_abort ();
    14      }
    15    else if (w != 0 || x != t->g || y != 0 || z != 12)
    16      __builtin_abort ();
    17  }
    18  
    19  __attribute__((noipa)) void
    20  foo (struct S *x, struct S *y, int *z, int w)
    21  {
    22    *o = w;
    23    if (w)
    24      bar (0, 0, 0, -1);
    25    x->d = z;
    26    if (y->d)
    27      y->c = y->c + y->d[0];
    28    bar (t->g, 0, y->c, 0);
    29  }
    30  
    31  int
    32  main ()
    33  {
    34    int a[4] = { 8, 9, 10, 11 };
    35    struct S s = { 1, 2, 3, &a[0] };
    36    struct T u = { 0, 0, &a[3] };
    37    o = &a[2];
    38    t = &u;
    39    foo (&s, &s, &a[1], 5);
    40    if (s.c != 12 || s.d != &a[1])
    41      __builtin_abort ();
    42    return 0;
    43  }