Module Name: src
Committed By: rillig
Date: Mon Apr 10 23:52:49 UTC 2023
Modified Files:
src/tests/usr.bin/xlint/lint1: msg_142.c t_integration.sh
Log Message:
tests/lint: demonstrate wrong warning with complex numbers
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/msg_142.c
cvs rdiff -u -r1.78 -r1.79 src/tests/usr.bin/xlint/lint1/t_integration.sh
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_142.c
diff -u src/tests/usr.bin/xlint/lint1/msg_142.c:1.8 src/tests/usr.bin/xlint/lint1/msg_142.c:1.9
--- src/tests/usr.bin/xlint/lint1/msg_142.c:1.8 Tue Mar 28 14:44:34 2023
+++ src/tests/usr.bin/xlint/lint1/msg_142.c Mon Apr 10 23:52:49 2023
@@ -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;
Index: src/tests/usr.bin/xlint/lint1/t_integration.sh
diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.78 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.79
--- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.78 Mon Feb 6 21:20:58 2023
+++ src/tests/usr.bin/xlint/lint1/t_integration.sh Mon Apr 10 23:52:49 2023
@@ -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)