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

     1  /* The fp-bit.c function __floatunsisf had a latent bug where guard bits
     2     could be lost leading to incorrect rounding.  */
     3  /* Origin: Joseph Myers <joseph@codesourcery.com> */
     4  
     5  extern void abort (void);
     6  extern void exit (int);
     7  #if __INT_MAX__ >= 0x7fffffff
     8  volatile unsigned u = 0x80000081;
     9  #else
    10  volatile unsigned long u = 0x80000081;
    11  #endif
    12  volatile float f1, f2;
    13  int
    14  main (void)
    15  {
    16    f1 = (float) u;
    17    f2 = (float) 0x80000081;
    18    if (f1 != f2)
    19      abort ();
    20    exit (0);
    21  }