Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: demonstrate wrong warn...
details: https://anonhg.NetBSD.org/src/rev/80e978f9bc82
branches: trunk
changeset: 374204:80e978f9bc82
user: rillig <rillig%NetBSD.org@localhost>
date: Mon Apr 10 23:52:49 2023 +0000
description:
tests/lint: demonstrate wrong warning with complex numbers
diffstat:
tests/usr.bin/xlint/lint1/msg_142.c | 12 ++++++++++--
tests/usr.bin/xlint/lint1/t_integration.sh | 4 +++-
2 files changed, 13 insertions(+), 3 deletions(-)
diffs (48 lines):
diff -r 474d98907f01 -r 80e978f9bc82 tests/usr.bin/xlint/lint1/msg_142.c
--- a/tests/usr.bin/xlint/lint1/msg_142.c Mon Apr 10 19:23:02 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_142.c Mon Apr 10 23:52:49 2023 +0000
@@ -1,12 +1,17 @@
-/* $NetBSD: msg_142.c,v 1.8 2023/03/28 14:44:34 rillig Exp $ */
+/* $NetBSD: msg_142.c,v 1.9 2023/04/10 23:52:49 rillig Exp $ */
# 3 "msg_142.c"
// Test for message: floating point overflow on operator '%s' [142]
-/* lint1-only-if: ldbl-64 */
/* lint1-extra-flags: -X 351 */
/*
+ * VAX has floating point formats with different limits than the other
+ * platforms, which all implement IEEE 754.
+ */
+/* xlint1-skip-if: vax */
+
+/*
* For 96-bit and 128-bit floating point numbers, a different number of
* multipliers is needed to produce an overflow.
*/
@@ -14,3 +19,6 @@
/* expect+2: warning: floating point overflow on operator '*' [142] */
/* expect+1: warning: floating point overflow on operator '*' [142] */
double dbl = 1e100 * 1e100 * 1e100 * 1e100 * 1e100;
+
+/* expect+1: warning: floating point overflow on operator '+' [142] */
+double _Complex complex_sum = 1e308 + 1e308i;
diff -r 474d98907f01 -r 80e978f9bc82 tests/usr.bin/xlint/lint1/t_integration.sh
--- a/tests/usr.bin/xlint/lint1/t_integration.sh Mon Apr 10 19:23:02 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/t_integration.sh Mon Apr 10 23:52:49 2023 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.78 2023/02/06 21:20:58 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.79 2023/04/10 23:52:49 rillig Exp $
#
# Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -62,6 +62,8 @@ configure_test_case()
}
function platform_has(prop) {
+ if (platform[prop] != "")
+ return prop == archsubdir
if (!match(prop, /^(schar|uchar|ilp32|lp64|int|long|ldbl-64|ldbl-96|ldbl-128)$/)) {
printf("bad property '\''%s'\''\n", prop) > "/dev/stderr"
exit(1)
Home |
Main Index |
Thread Index |
Old Index