(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.c-torture/
execute/
pr70566.c
       1  /* PR target/70566.  */
       2  
       3  #define NULL 0
       4  
       5  struct mystruct
       6  {
       7    unsigned int f1 : 1;
       8    unsigned int f2 : 1;
       9    unsigned int f3 : 1;
      10  };
      11  
      12  __attribute__ ((noinline)) void
      13  myfunc (int a, void *b)
      14  {
      15  }
      16  __attribute__ ((noinline)) int
      17  myfunc2 (void *a)
      18  {
      19    return 0;
      20  }
      21  
      22  static void
      23  set_f2 (struct mystruct *user, int f2)
      24  {
      25    if (user->f2 != f2)
      26      myfunc (myfunc2 (NULL), NULL);
      27    else
      28      __builtin_abort ();
      29  }
      30  
      31  __attribute__ ((noinline)) void
      32  foo (void *data)
      33  {
      34    struct mystruct *user = data;
      35    if (!user->f2)
      36      set_f2 (user, 1);
      37  }
      38  
      39  int
      40  main (void)
      41  {
      42    struct mystruct a;
      43    a.f1 = 1;
      44    a.f2 = 0;
      45    foo (&a);
      46    return 0;
      47  }