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

     1  /* PR rtl-optimization/51667 */
     2  /* Testcase by Uros Bizjak <ubizjak@gmail.com> */
     3  
     4  extern void abort (void);
     5  
     6  void __attribute__((noinline,noclone))
     7  bar (int a)
     8  {
     9    if (a != -1)
    10      abort ();
    11  }
    12  
    13  void __attribute__((noinline,noclone))
    14  foo (short *a, int t)
    15  {
    16    short r = *a;
    17  
    18    if (t)
    19      bar ((unsigned short) r);
    20    else
    21      bar ((signed short) r);
    22  }
    23  
    24  short v = -1;
    25  
    26  int main(void)
    27  {
    28    foo (&v, 0);
    29    return 0;
    30  }