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

     1  /* PR rtl-optimization/57829 */
     2  
     3  __attribute__((noinline, noclone))
     4  int
     5  f1 (int k)
     6  {
     7    return 2 | ((k - 1) >> ((int) sizeof (int) * __CHAR_BIT__ - 1));
     8  }
     9  
    10  __attribute__((noinline, noclone))
    11  long int
    12  f2 (long int k)
    13  {
    14    return 2L | ((k - 1L) >> ((int) sizeof (long int) * __CHAR_BIT__ - 1));
    15  }
    16  
    17  __attribute__((noinline, noclone))
    18  int
    19  f3 (int k)
    20  {
    21    k &= 63;
    22    return 4 | ((k + 2) >> 5);
    23  }
    24  
    25  int
    26  main ()
    27  {
    28    if (f1 (1) != 2 || f2 (1L) != 2L || f3 (63) != 6 || f3 (1) != 4)
    29      __builtin_abort ();
    30    return 0;
    31  }