Module Name: src Committed By: rillig Date: Sat Jan 21 17:48:29 UTC 2023
Modified Files: src/tests/usr.bin/xlint/lint1: msg_248.c Log Message: lint: add test for floating constant overflow To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_248.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/usr.bin/xlint/lint1/msg_248.c diff -u src/tests/usr.bin/xlint/lint1/msg_248.c:1.3 src/tests/usr.bin/xlint/lint1/msg_248.c:1.4 --- src/tests/usr.bin/xlint/lint1/msg_248.c:1.3 Thu Jun 16 21:24:41 2022 +++ src/tests/usr.bin/xlint/lint1/msg_248.c Sat Jan 21 17:48:29 2023 @@ -1,8 +1,12 @@ -/* $NetBSD: msg_248.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_248.c,v 1.4 2023/01/21 17:48:29 rillig Exp $ */ # 3 "msg_248.c" // Test for message: floating-point constant out of range [248] -/* expect+1: error: syntax error ':' [249] */ -TODO: "Add example code that triggers the above message." -TODO: "Add example code that almost triggers the above message." +float fits_flt = 1e37f; +/* expect+1: warning: floating-point constant out of range [248] */ +float too_large_flt = 1e40f; + +double fits_dbl = 1e300; +/* expect+1: warning: floating-point constant out of range [248] */ +double too_large_dbl = 1e310;