lex_floating.c revision 1.4
1/*	$NetBSD: lex_floating.c,v 1.4 2023/03/28 14:44:34 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
10/* lint1-extra-flags: -X 351 */
11
12void sinkf(float);
13void sinkd(double);
14void sinkl(long double);
15
16void
17test_float(void)
18{
19	sinkf(0.0F);
20	sinkf(0.0f);
21	sinkf(-0.0F);
22	sinkf(-0.0f);
23}
24
25void
26test_double(void)
27{
28	// https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4396272
29	sinkd(2.2250738585072012e-308);
30	/* expect+1: error: syntax error 'x' [249] */
31	sinkd(1.23x);
32}
33
34void
35test_long_double(void)
36{
37	sinkl(2.2250738585072012e-308L);
38}
39
40void
41test_hex(void)
42{
43	sinkd(0x1.cp4);
44}
45