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

     1  /* Test whether division by constant works properly.  */
     2  
     3  extern void abort (void);
     4  extern void exit (int);
     5  
     6  unsigned char cx = 7;
     7  unsigned short sx = 14;
     8  unsigned int ix = 21;
     9  unsigned long lx = 28;
    10  unsigned long long Lx = 35;
    11  
    12  int
    13  main ()
    14  {
    15    unsigned char cy;
    16    unsigned short sy;
    17    unsigned int iy;
    18    unsigned long ly;
    19    unsigned long long Ly;
    20    
    21    cy = cx / 6; if (cy != 1) abort ();
    22    cy = cx % 6; if (cy != 1) abort ();
    23  
    24    sy = sx / 6; if (sy != 2) abort ();
    25    sy = sx % 6; if (sy != 2) abort ();
    26  
    27    iy = ix / 6; if (iy != 3) abort ();
    28    iy = ix % 6; if (iy != 3) abort ();
    29  
    30    ly = lx / 6; if (ly != 4) abort ();
    31    ly = lx % 6; if (ly != 4) abort ();
    32  
    33    Ly = Lx / 6; if (Ly != 5) abort ();
    34    Ly = Lx % 6; if (Ly != 5) abort ();
    35  
    36    exit(0);
    37  }