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

     1  /* PR rtl-optimization/88904 */
     2  
     3  volatile int v;
     4  
     5  __attribute__((noipa)) void
     6  bar (const char *x, const char *y, int z)
     7  {
     8    if (!v)
     9      __builtin_abort ();
    10    asm volatile ("" : "+g" (x));
    11    asm volatile ("" : "+g" (y));
    12    asm volatile ("" : "+g" (z));
    13  }
    14  
    15  #define my_assert(e) ((e) ? (void) 0 : bar (#e, __FILE__, __LINE__))
    16  
    17  typedef struct {
    18    unsigned M1;
    19    unsigned M2 : 1;
    20    int : 0;
    21    unsigned M3 : 1;
    22  } S;
    23  
    24  S
    25  foo ()
    26  {
    27    S result = {0, 0, 1};
    28    return result;
    29  }
    30  
    31  int
    32  main ()
    33  {
    34    S ret = foo ();
    35    my_assert (ret.M2 == 0);
    36    my_assert (ret.M3 == 1);
    37    return 0;
    38  }