public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/gabriel/powerpc-ieee128-printscan] ldbl-128ibm-compat: Test positional arguments
@ 2019-10-25 15:33 Gabriel F.T.Gomes
0 siblings, 0 replies; 3+ messages in thread
From: Gabriel F.T.Gomes @ 2019-10-25 15:33 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=15928276f9a32995af199bffe13b044d14e49870
commit 15928276f9a32995af199bffe13b044d14e49870
Author: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
Date: Thu Jul 11 11:47:12 2019 -0300
ldbl-128ibm-compat: Test positional arguments
No changes since v1.
-- 8< --
The format string can request positional parameters, instead of relying
on the order in which they appear as arguments. Since this has an
effect on how the type of each argument is determined, this patch
extends the test cases to use positional parameters with mixed double
and long double types, to verify that the IEEE long double
implementations of *printf work correctly in this scenario.
Tested for powerpc64le.
Diff:
---
.../ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c | 12 +++++++++++-
sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c | 12 +++++++++++-
.../ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c | 9 ++++++++-
.../ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c | 9 ++++++++-
4 files changed, 38 insertions(+), 4 deletions(-)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c
index e8e1244..153a35d 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c
@@ -139,6 +139,10 @@ do_test_call (void)
/* Print in hexadecimal notation. */
do_test_call_rarg (stdout, "%.10La, %.10a", ld, d);
do_test_call_varg (stdout, "%.10La, %.10a", ld, d);
+
+ /* Test positional parameters. */
+ do_test_call_varg (stdout, "%3$Lf, %2$Lf, %1$f",
+ (double) 1, (long double) 2, (long double) 3);
}
static int
@@ -172,7 +176,13 @@ do_test (void)
" __vfprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" __vprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" __vsnprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
- " __vsprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n";
+ " __vsprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
+ " __vasprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vdprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vfprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vsnprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vsprintf_chk: 3.000000, 2.000000, 1.000000\n";
TEST_COMPARE_STRING (expected, result.out.buffer);
return 0;
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c
index 2b8d424..5b0e8d3 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c
@@ -130,6 +130,10 @@ do_test_call (void)
/* Print in hexadecimal notation. */
do_test_call_rarg (stdout, "%.10La, %.10a", ld, d);
do_test_call_varg (stdout, "%.10La, %.10a", ld, d);
+
+ /* Test positional parameters. */
+ do_test_call_varg (stdout, "%3$Lf, %2$Lf, %1$f",
+ (double) 1, (long double) 2, (long double) 3);
}
static int
@@ -163,7 +167,13 @@ do_test (void)
" vfprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" vprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" vsnprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
- " vsprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n";
+ " vsprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
+ " vasprintf: 3.000000, 2.000000, 1.000000\n"
+ " vdprintf: 3.000000, 2.000000, 1.000000\n"
+ " vfprintf: 3.000000, 2.000000, 1.000000\n"
+ " vprintf: 3.000000, 2.000000, 1.000000\n"
+ " vsnprintf: 3.000000, 2.000000, 1.000000\n"
+ " vsprintf: 3.000000, 2.000000, 1.000000\n";
TEST_COMPARE_STRING (expected, result.out.buffer);
return 0;
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c
index 0dcabec..4917462 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c
@@ -85,6 +85,10 @@ do_test_call (void)
/* Print in hexadecimal notation. */
do_test_call_rarg (stdout, L"%.10La, %.10a", ld, d);
do_test_call_varg (stdout, L"%.10La, %.10a", ld, d);
+
+ /* Test positional parameters. */
+ do_test_call_varg (stdout, L"%3$Lf, %2$Lf, %1$f",
+ (double) 1, (long double) 2, (long double) 3);
}
static int
@@ -106,7 +110,10 @@ do_test (void)
" __wprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" __vfwprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" __vswprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
- " __vwprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n";
+ " __vwprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
+ " __vfwprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vswprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vwprintf_chk: 3.000000, 2.000000, 1.000000\n";
TEST_COMPARE_STRING (expected, result.out.buffer);
return 0;
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c
index def4337..008275f 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c
@@ -83,6 +83,10 @@ do_test_call (void)
/* Print in hexadecimal notation. */
do_test_call_rarg (stdout, L"%.10La, %.10a", ld, d);
do_test_call_varg (stdout, L"%.10La, %.10a", ld, d);
+
+ /* Test positional parameters. */
+ do_test_call_varg (stdout, L"%3$Lf, %2$Lf, %1$f",
+ (double) 1, (long double) 2, (long double) 3);
}
static int
@@ -104,7 +108,10 @@ do_test (void)
" wprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" vfwprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" vswprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
- " vwprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n";
+ " vwprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
+ " vfwprintf: 3.000000, 2.000000, 1.000000\n"
+ " vswprintf: 3.000000, 2.000000, 1.000000\n"
+ " vwprintf: 3.000000, 2.000000, 1.000000\n";
TEST_COMPARE_STRING (expected, result.out.buffer);
return 0;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [glibc/gabriel/powerpc-ieee128-printscan] ldbl-128ibm-compat: Test positional arguments
@ 2019-10-15 19:02 Gabriel F.T.Gomes
0 siblings, 0 replies; 3+ messages in thread
From: Gabriel F.T.Gomes @ 2019-10-15 19:02 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=58e96547f70914e57cade21dd5b4b7d15edaa71a
commit 58e96547f70914e57cade21dd5b4b7d15edaa71a
Author: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
Date: Thu Jul 11 11:47:12 2019 -0300
ldbl-128ibm-compat: Test positional arguments
The format string can request positional parameters, instead of relying
on the order in which they appear as arguments. Since this has an
effect on how the type of each argument is determined, this patch
extends the test cases to use positional parameters with mixed double
and long double types, to verify that the IEEE long double
implementations of *printf work correctly in this scenario.
Tested for powerpc64le.
Diff:
---
.../ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c | 12 +++++++++++-
sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c | 12 +++++++++++-
.../ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c | 9 ++++++++-
.../ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c | 9 ++++++++-
4 files changed, 38 insertions(+), 4 deletions(-)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c
index e8e1244..153a35d 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c
@@ -139,6 +139,10 @@ do_test_call (void)
/* Print in hexadecimal notation. */
do_test_call_rarg (stdout, "%.10La, %.10a", ld, d);
do_test_call_varg (stdout, "%.10La, %.10a", ld, d);
+
+ /* Test positional parameters. */
+ do_test_call_varg (stdout, "%3$Lf, %2$Lf, %1$f",
+ (double) 1, (long double) 2, (long double) 3);
}
static int
@@ -172,7 +176,13 @@ do_test (void)
" __vfprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" __vprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" __vsnprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
- " __vsprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n";
+ " __vsprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
+ " __vasprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vdprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vfprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vsnprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vsprintf_chk: 3.000000, 2.000000, 1.000000\n";
TEST_COMPARE_STRING (expected, result.out.buffer);
return 0;
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c
index 2b8d424..5b0e8d3 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c
@@ -130,6 +130,10 @@ do_test_call (void)
/* Print in hexadecimal notation. */
do_test_call_rarg (stdout, "%.10La, %.10a", ld, d);
do_test_call_varg (stdout, "%.10La, %.10a", ld, d);
+
+ /* Test positional parameters. */
+ do_test_call_varg (stdout, "%3$Lf, %2$Lf, %1$f",
+ (double) 1, (long double) 2, (long double) 3);
}
static int
@@ -163,7 +167,13 @@ do_test (void)
" vfprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" vprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" vsnprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
- " vsprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n";
+ " vsprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
+ " vasprintf: 3.000000, 2.000000, 1.000000\n"
+ " vdprintf: 3.000000, 2.000000, 1.000000\n"
+ " vfprintf: 3.000000, 2.000000, 1.000000\n"
+ " vprintf: 3.000000, 2.000000, 1.000000\n"
+ " vsnprintf: 3.000000, 2.000000, 1.000000\n"
+ " vsprintf: 3.000000, 2.000000, 1.000000\n";
TEST_COMPARE_STRING (expected, result.out.buffer);
return 0;
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c
index 0dcabec..4917462 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c
@@ -85,6 +85,10 @@ do_test_call (void)
/* Print in hexadecimal notation. */
do_test_call_rarg (stdout, L"%.10La, %.10a", ld, d);
do_test_call_varg (stdout, L"%.10La, %.10a", ld, d);
+
+ /* Test positional parameters. */
+ do_test_call_varg (stdout, L"%3$Lf, %2$Lf, %1$f",
+ (double) 1, (long double) 2, (long double) 3);
}
static int
@@ -106,7 +110,10 @@ do_test (void)
" __wprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" __vfwprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" __vswprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
- " __vwprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n";
+ " __vwprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
+ " __vfwprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vswprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vwprintf_chk: 3.000000, 2.000000, 1.000000\n";
TEST_COMPARE_STRING (expected, result.out.buffer);
return 0;
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c
index def4337..008275f 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c
@@ -83,6 +83,10 @@ do_test_call (void)
/* Print in hexadecimal notation. */
do_test_call_rarg (stdout, L"%.10La, %.10a", ld, d);
do_test_call_varg (stdout, L"%.10La, %.10a", ld, d);
+
+ /* Test positional parameters. */
+ do_test_call_varg (stdout, L"%3$Lf, %2$Lf, %1$f",
+ (double) 1, (long double) 2, (long double) 3);
}
static int
@@ -104,7 +108,10 @@ do_test (void)
" wprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" vfwprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" vswprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
- " vwprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n";
+ " vwprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
+ " vfwprintf: 3.000000, 2.000000, 1.000000\n"
+ " vswprintf: 3.000000, 2.000000, 1.000000\n"
+ " vwprintf: 3.000000, 2.000000, 1.000000\n";
TEST_COMPARE_STRING (expected, result.out.buffer);
return 0;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [glibc/gabriel/powerpc-ieee128-printscan] ldbl-128ibm-compat: Test positional arguments
@ 2019-08-09 18:35 Gabriel F.T.Gomes
0 siblings, 0 replies; 3+ messages in thread
From: Gabriel F.T.Gomes @ 2019-08-09 18:35 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3b54a4783b0b37a267246b62dc40f6a48b4e0bd3
commit 3b54a4783b0b37a267246b62dc40f6a48b4e0bd3
Author: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
Date: Thu Jul 11 11:47:12 2019 -0300
ldbl-128ibm-compat: Test positional arguments
The format string can request positional parameters, instead of relying
on the order in which they appear as arguments. Since this has an
effect on how the type of each argument is determined, this patch
extends the test cases to use positional parameters with mixed double
and long double types, to verify that the IEEE long double
implementations of *printf work correctly in this scenario.
Tested for powerpc64le.
* sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c
* sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c
* sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c
* sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c
(do_test_call): Test positional parameters.
(do_test): Add results for positional parameters test.
Diff:
---
.../ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c | 12 +++++++++++-
sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c | 12 +++++++++++-
.../ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c | 9 ++++++++-
.../ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c | 9 ++++++++-
4 files changed, 38 insertions(+), 4 deletions(-)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c
index e8e1244..153a35d 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c
@@ -139,6 +139,10 @@ do_test_call (void)
/* Print in hexadecimal notation. */
do_test_call_rarg (stdout, "%.10La, %.10a", ld, d);
do_test_call_varg (stdout, "%.10La, %.10a", ld, d);
+
+ /* Test positional parameters. */
+ do_test_call_varg (stdout, "%3$Lf, %2$Lf, %1$f",
+ (double) 1, (long double) 2, (long double) 3);
}
static int
@@ -172,7 +176,13 @@ do_test (void)
" __vfprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" __vprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" __vsnprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
- " __vsprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n";
+ " __vsprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
+ " __vasprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vdprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vfprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vsnprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vsprintf_chk: 3.000000, 2.000000, 1.000000\n";
TEST_COMPARE_STRING (expected, result.out.buffer);
return 0;
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c
index 2b8d424..5b0e8d3 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-ldbl-compat.c
@@ -130,6 +130,10 @@ do_test_call (void)
/* Print in hexadecimal notation. */
do_test_call_rarg (stdout, "%.10La, %.10a", ld, d);
do_test_call_varg (stdout, "%.10La, %.10a", ld, d);
+
+ /* Test positional parameters. */
+ do_test_call_varg (stdout, "%3$Lf, %2$Lf, %1$f",
+ (double) 1, (long double) 2, (long double) 3);
}
static int
@@ -163,7 +167,13 @@ do_test (void)
" vfprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" vprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" vsnprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
- " vsprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n";
+ " vsprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
+ " vasprintf: 3.000000, 2.000000, 1.000000\n"
+ " vdprintf: 3.000000, 2.000000, 1.000000\n"
+ " vfprintf: 3.000000, 2.000000, 1.000000\n"
+ " vprintf: 3.000000, 2.000000, 1.000000\n"
+ " vsnprintf: 3.000000, 2.000000, 1.000000\n"
+ " vsprintf: 3.000000, 2.000000, 1.000000\n";
TEST_COMPARE_STRING (expected, result.out.buffer);
return 0;
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c
index 0dcabec..4917462 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-chk-ldbl-compat.c
@@ -85,6 +85,10 @@ do_test_call (void)
/* Print in hexadecimal notation. */
do_test_call_rarg (stdout, L"%.10La, %.10a", ld, d);
do_test_call_varg (stdout, L"%.10La, %.10a", ld, d);
+
+ /* Test positional parameters. */
+ do_test_call_varg (stdout, L"%3$Lf, %2$Lf, %1$f",
+ (double) 1, (long double) 2, (long double) 3);
}
static int
@@ -106,7 +110,10 @@ do_test (void)
" __wprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" __vfwprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" __vswprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
- " __vwprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n";
+ " __vwprintf_chk: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
+ " __vfwprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vswprintf_chk: 3.000000, 2.000000, 1.000000\n"
+ " __vwprintf_chk: 3.000000, 2.000000, 1.000000\n";
TEST_COMPARE_STRING (expected, result.out.buffer);
return 0;
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c
index def4337..008275f 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-wprintf-ldbl-compat.c
@@ -83,6 +83,10 @@ do_test_call (void)
/* Print in hexadecimal notation. */
do_test_call_rarg (stdout, L"%.10La, %.10a", ld, d);
do_test_call_varg (stdout, L"%.10La, %.10a", ld, d);
+
+ /* Test positional parameters. */
+ do_test_call_varg (stdout, L"%3$Lf, %2$Lf, %1$f",
+ (double) 1, (long double) 2, (long double) 3);
}
static int
@@ -104,7 +108,10 @@ do_test (void)
" wprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" vfwprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
" vswprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
- " vwprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n";
+ " vwprintf: -0x1.0000000000p+0, -0x1.0000000000p+0\n"
+ " vfwprintf: 3.000000, 2.000000, 1.000000\n"
+ " vswprintf: 3.000000, 2.000000, 1.000000\n"
+ " vwprintf: 3.000000, 2.000000, 1.000000\n";
TEST_COMPARE_STRING (expected, result.out.buffer);
return 0;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-25 15:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-25 15:33 [glibc/gabriel/powerpc-ieee128-printscan] ldbl-128ibm-compat: Test positional arguments Gabriel F.T.Gomes
-- strict thread matches above, loose matches on Subject: below --
2019-10-15 19:02 Gabriel F.T.Gomes
2019-08-09 18:35 Gabriel F.T.Gomes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).