diff options
| author | rillig <rillig@NetBSD.org> | 2023-01-21 17:48:29 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2023-01-21 17:48:29 +0000 |
| commit | 129b0c3ba0fc46095fcd205dd2b2feed85e6da9b (patch) | |
| tree | 0b62d1d8595f4b1b25f60d1c8a695fbda0afcbbc /tests | |
| parent | ddba23bf1f9c34e951e8402f15e260dade09daad (diff) | |
lint: add test for floating constant overflow
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/usr.bin/xlint/lint1/msg_248.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/usr.bin/xlint/lint1/msg_248.c b/tests/usr.bin/xlint/lint1/msg_248.c index efe9aa651c7..b392672945d 100644 --- a/tests/usr.bin/xlint/lint1/msg_248.c +++ b/tests/usr.bin/xlint/lint1/msg_248.c @@ -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; |
