Module Name:    src
Committed By:   rillig
Date:           Sat Jun 22 06:24:46 UTC 2024

Modified Files:
        src/tests/usr.bin/xlint/lint1: msg_380.c msg_381.c

Log Message:
tests/lint: skip tests for converting large floating point to integer

These tests differ between the platforms supported by lint.  The
differences may be caused by hardware differences, the default rounding
mode, bugs in the emulator running the tests, bugs in the
platform-specific string-to-float or float-to-string conversions and
probably some more.

For now, accept that lint will behave differently on those platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_380.c \
    src/tests/usr.bin/xlint/lint1/msg_381.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_380.c
diff -u src/tests/usr.bin/xlint/lint1/msg_380.c:1.1 src/tests/usr.bin/xlint/lint1/msg_380.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_380.c:1.1	Sun Jun  9 10:27:39 2024
+++ src/tests/usr.bin/xlint/lint1/msg_380.c	Sat Jun 22 06:24:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_380.c,v 1.1 2024/06/09 10:27:39 rillig Exp $	*/
+/*	$NetBSD: msg_380.c,v 1.2 2024/06/22 06:24:46 rillig Exp $	*/
 # 3 "msg_380.c"
 
 // Test for message: lossy conversion of %Lg to '%s', arg #%d [380]
@@ -50,11 +50,22 @@ conversions(void)
 	take_u64(0.0);
 	/* expect+1: warning: lossy conversion of 3.141 to 'unsigned long long', arg #1 [380] */
 	take_u64(3.141);
-	take_u64(18446744073709550591.0);
-	/* expect+1: warning: lossy conversion of 1.84467e+19 to 'unsigned long long', arg #1 [380] */
-	take_u64(18446744073709550592.0);
-	/* expect+1: warning: lossy conversion of 1.84467e+19 to 'unsigned long long', arg #1 [380] */
-	take_u64(18446744073709551615.0);
-	/* expect+1: warning: lossy conversion of 1.84467e+19 to 'unsigned long long', arg #1 [380] */
-	take_u64(18446744073709551616.0);
+
+	// Warning on:		alpha
+	// No warning on:	aarch64 aarch64-compat32 arm i386 mips powerpc riscv64 sh3 sparc x86_64
+	// Unknown:		coldfire hppa ia64 m68000 m68k mips64 mipsn64 or1k powerpc64 riscv32 sparc64 vax
+	//
+	// warning: lossy conversion of 1.84467e+19 to 'unsigned long long', arg #1 [380]
+	//take_u64(18446744073709550591.0);
+
+	// Warning on:		aarch64 alpha arm i386 mips riscv64 sparc x86_64
+	// No warning on:	aarch64-compat32 powerpc sh3
+	// Unknown:		coldfire hppa ia64 m68000 m68k mips64 mipsn64 or1k powerpc64 riscv32 sparc64 vax
+	//
+	// warning: lossy conversion of 1.84467e+19 to 'unsigned long long', arg #1 [380]
+	//take_u64(18446744073709550592.0);
+	// warning: lossy conversion of 1.84467e+19 to 'unsigned long long', arg #1 [380]
+	//take_u64(18446744073709551615.0);
+	// warning: lossy conversion of 1.84467e+19 to 'unsigned long long', arg #1 [380]
+	//take_u64(18446744073709551616.0);
 }
Index: src/tests/usr.bin/xlint/lint1/msg_381.c
diff -u src/tests/usr.bin/xlint/lint1/msg_381.c:1.1 src/tests/usr.bin/xlint/lint1/msg_381.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_381.c:1.1	Sun Jun  9 10:27:39 2024
+++ src/tests/usr.bin/xlint/lint1/msg_381.c	Sat Jun 22 06:24:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_381.c,v 1.1 2024/06/09 10:27:39 rillig Exp $	*/
+/*	$NetBSD: msg_381.c,v 1.2 2024/06/22 06:24:46 rillig Exp $	*/
 # 3 "msg_381.c"
 
 // Test for message: lossy conversion of %Lg to '%s' [381]
@@ -50,11 +50,22 @@ conversions(void)
 	u64 = 0.0;
 	/* expect+1: warning: lossy conversion of 3.141 to 'unsigned long long' [381] */
 	u64 = 3.141;
-	u64 = 18446744073709550591.0;
-	/* expect+1: warning: lossy conversion of 1.84467e+19 to 'unsigned long long' [381] */
-	u64 = 18446744073709550592.0;
-	/* expect+1: warning: lossy conversion of 1.84467e+19 to 'unsigned long long' [381] */
-	u64 = 18446744073709551615.0;
-	/* expect+1: warning: lossy conversion of 1.84467e+19 to 'unsigned long long' [381] */
-	u64 = 18446744073709551616.0;
+
+	// Warning on:		alpha
+	// No warning on:	aarch64 aarch64-compat32 arm i386 mips powerpc riscv64 sh3 sparc x86_64
+	// Unknown:		coldfire hppa ia64 m68000 m68k mips64 mipsn64 or1k powerpc64 riscv32 sparc64 vax
+	//
+	// warning: lossy conversion of 1.84467e+19 to 'unsigned long long' [381]
+	//u64 = 18446744073709550591.0;
+
+	// Warning on:		aarch64 alpha arm i386 mips riscv64 sparc x86_64
+	// No warning on:	aarch64-compat32 powerpc sh3
+	// Unknown:		coldfire hppa ia64 m68000 m68k mips64 mipsn64 or1k powerpc64 riscv32 sparc64 vax
+	//
+	// warning: lossy conversion of 1.84467e+19 to 'unsigned long long' [381]
+	//u64 = 18446744073709550592.0;
+	// warning: lossy conversion of 1.84467e+19 to 'unsigned long long' [381]
+	//u64 = 18446744073709551615.0;
+	// warning: lossy conversion of 1.84467e+19 to 'unsigned long long' [381]
+	//u64 = 18446744073709551616.0;
 }

Reply via email to