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

     1  /* PR tree-optimization/56051 */
     2  
     3  extern void abort (void);
     4  
     5  int
     6  main ()
     7  {
     8    unsigned char x1[1] = { 0 };
     9    unsigned int s1 = __CHAR_BIT__;
    10    int a1 = x1[0] < (unsigned char) (1 << s1);
    11    unsigned char y1 = (unsigned char) (1 << s1);
    12    int b1 = x1[0] < y1;
    13    if (a1 != b1)
    14      abort ();
    15  #if __SIZEOF_LONG_LONG__ > __SIZEOF_INT__
    16    unsigned long long x2[1] = { 2ULL << (sizeof (int) * __CHAR_BIT__) };
    17    unsigned int s2 = sizeof (int) * __CHAR_BIT__ - 1;
    18    int a2 = x2[0] >= (unsigned long long) (1 << s2);
    19    unsigned long long y2 = 1 << s2;
    20    int b2 = x2[0] >= y2;
    21    if (a2 != b2)
    22      abort ();
    23    unsigned long long x3[1] = { 2ULL << (sizeof (int) * __CHAR_BIT__) };
    24    unsigned int s3 = sizeof (int) * __CHAR_BIT__ - 1;
    25    int a3 = x3[0] >= (unsigned long long) (1U << s3);
    26    unsigned long long y3 = 1U << s3;
    27    int b3 = x3[0] >= y3;
    28    if (a3 != b3)
    29      abort ();
    30  #endif
    31    return 0;
    32  }