1/* { dg-do compile } */ 2/* { dg-options "-Wall" } */ 3 4/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma. 5 C99 6.4.4.2a (New). 6 7 Check that when pragma FLOAT_CONST_DECIMAL64 is in effect so that 8 unsuffixed constants are _Decimal64, invalid types are still reported 9 as invalid. */ 10 11double 12f1 (void) 13{ 14#pragma STDC FLOAT_CONST_DECIMAL64 OFF 15 double a = 0x1.0p1; 16 double b = 1.0i; 17 18 return a + b; 19} 20 21double 22f2 (void) 23{ 24#pragma STDC FLOAT_CONST_DECIMAL64 OFF 25 double a = 0x1.0p1dd; /* { dg-error "with hex" } */ 26 double b = 1.0idd; /* { dg-error "invalid suffix" } */ 27 28 return a + b; 29} 30 31double 32f3 (void) 33{ 34#pragma STDC FLOAT_CONST_DECIMAL64 ON 35 double a = 0x1.0p1; /* Hex constant is not affected by pragma. */ 36 double b = 1.0i; /* Imaginary constant is not affected by pragma. */ 37 38 return a + b; 39} 40