This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix bogus long double printf formats


The tests huge_struct and cls_longdouble_va fail everywhere due a bogus
printf format.

Andreas.

2009-11-08  Andreas Schwab  <schwab@linux-m68k.org>

	* testsuite/libffi.call/huge_struct.c (test_large_fn): Fix long
	double printf format.
	(main): Likewise.
	* testsuite/libffi.call/cls_longdouble_va.c (main): Likewise.

Index: testsuite/libffi.call/cls_longdouble_va.c
===================================================================
RCS file: /cvs/libffi/libffi/testsuite/libffi.call/cls_longdouble_va.c,v
retrieving revision 1.7
diff -u -a -p -r1.7 cls_longdouble_va.c
--- testsuite/libffi.call/cls_longdouble_va.c	16 Jun 2009 09:59:02 -0000	1.7
+++ testsuite/libffi.call/cls_longdouble_va.c	8 Nov 2009 10:13:56 -0000
@@ -26,7 +26,7 @@ int main (void)
 	void* args[3];
 	ffi_type* arg_types[3];
 
-	char*		format	= "%L.1f\n";
+	char*		format	= "%.1Lf\n";
 	long double	ldArg	= 7;
 	ffi_arg		res		= 0;
 
Index: testsuite/libffi.call/huge_struct.c
===================================================================
RCS file: /cvs/libffi/libffi/testsuite/libffi.call/huge_struct.c,v
retrieving revision 1.3
diff -u -a -p -r1.3 huge_struct.c
--- testsuite/libffi.call/huge_struct.c	16 Jun 2009 09:59:02 -0000	1.3
+++ testsuite/libffi.call/huge_struct.c	8 Nov 2009 10:13:56 -0000
@@ -131,14 +131,14 @@ test_large_fn(
 			ui64_4 + 4, si64_4 + 4, f_4 + 4, d_4 + 4, ld_4 + 4, (char*)((intptr_t)p_4 + 4), 
 		ui8_5 + 5, si8_5 + 5};
 
-	printf("%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p "
-		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p "
-		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p "
-		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p %hhu %hhd: "
-		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p "
-		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p "
-		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p "
-		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p %hhu %hhd\n",
+	printf("%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p "
+		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p "
+		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p "
+		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p %hhu %hhd: "
+		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p "
+		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p "
+		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p "
+		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p %hhu %hhd\n",
 		ui8_1, si8_1, ui16_1, si16_1, ui32_1, si32_1, ui64_1, si64_1, f_1, d_1, ld_1, p_1,
 		ui8_2, si8_2, ui16_2, si16_2, ui32_2, si32_2, ui64_2, si64_2, f_2, d_2, ld_2, p_2,
 		ui8_3, si8_3, ui16_3, si16_3, ui32_3, si32_3, ui64_3, si64_3, f_3, d_3, ld_3, p_3,
@@ -296,10 +296,10 @@ main(int argc __UNUSED__, const char** a
 
 	ffi_call(&cif, FFI_FN(test_large_fn), &retVal, argValues);
 	// { dg-output "1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
-	printf("res: %hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p "
-		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p "
-		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p "
-		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p %hhu %hhd\n",
+	printf("res: %hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p "
+		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p "
+		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p "
+		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p %hhu %hhd\n",
 		retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
 		retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, retVal.l,
 		retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
@@ -324,10 +324,10 @@ main(int argc __UNUSED__, const char** a
 		ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
 		ui8, si8);
 	// { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
-	printf("res: %hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p "
-		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p "
-		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p "
-		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %L.0f %p %hhu %hhd\n",
+	printf("res: %hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p "
+		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p "
+		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p "
+		"%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %p %hhu %hhd\n",
 		retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
 		retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, retVal.l,
 		retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]