lex_floating.c revision 1.2
1/* $NetBSD: lex_floating.c,v 1.2 2022/01/15 14:22:03 rillig Exp $ */ 2# 3 "lex_floating.c" 3 4/* 5 * Tests for lexical analysis of floating constants. 6 * 7 * C99 6.4.4.2 "Floating constants" 8 */ 9 10void sinkf(float); 11void sinkd(double); 12void sinkl(long double); 13 14void 15test_float(void) 16{ 17 sinkf(0.0F); 18 sinkf(0.0f); 19 sinkf(-0.0F); 20 sinkf(-0.0f); 21} 22 23void 24test_double(void) 25{ 26 // https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4396272 27 sinkd(2.2250738585072012e-308); 28 /* expect+1: error: syntax error 'x' [249] */ 29 sinkd(1.23x); 30} 31 32void 33test_long_double(void) 34{ 35 sinkl(2.2250738585072012e-308L); 36} 37