1  /* Test for correct rounding of conversions from __int128 to
       2     float.  */
       3  /* { dg-do run } */
       4  /* { dg-require-effective-target int128 } */
       5  /* { dg-options "-frounding-math" } */
       6  
       7  #include <stdlib.h>
       8  
       9  int
      10  main (void)
      11  {
      12    volatile unsigned long long h = 0x8000000000000000LL;
      13    volatile unsigned long long l = 0xdLL;
      14    volatile unsigned __int128 u128 = (((unsigned __int128) h) << 64) | l;
      15    volatile __int128 s128 = u128;
      16    float fs = s128;
      17    if (fs != -0x1p+127)
      18      abort ();
      19    double ds = s128;
      20    if (ds != -0x1p+127)
      21      abort ();
      22    exit (0);
      23  }