1 /* Test for correct rounding of conversions from __int128 to 2 float. */ 3 /* { dg-do run } */ 4 /* { dg-require-effective-target int128 } */ 5 /* { dg-require-effective-target fenv } */ 6 /* { dg-options "-frounding-math" } */ 7 /* { dg-xfail-run-if "see PR80556 c63" { x86_64-*-darwin* i68?-*-darwin* } { "*" } { "" } } */ 8 9 #include <fenv.h> 10 #include <stdlib.h> 11 12 int main(void)13main (void) 14 { 15 #ifdef FE_TOWARDZERO 16 volatile unsigned long long h = 0x8000000000000000LL; 17 volatile unsigned long long l = 0xdLL; 18 volatile unsigned __int128 u128 = (((unsigned __int128) h) << 64) | l; 19 volatile __int128 s128 = u128; 20 fesetround (FE_TOWARDZERO); 21 float fs = s128; 22 if (fs != -0x1.fffffep+126) 23 abort (); 24 double ds = s128; 25 if (ds != -0x1.fffffffffffffp+126) 26 abort (); 27 #endif 28 exit (0); 29 } 30