Blame stdio-common/tst-printf.sh

Packit 6c4009
#!/bin/sh
Packit 6c4009
# Testing of printf.
Packit 6c4009
# Copyright (C) 2000-2018 Free Software Foundation, Inc.
Packit 6c4009
# This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
# The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
# modify it under the terms of the GNU Lesser General Public
Packit 6c4009
# License as published by the Free Software Foundation; either
Packit 6c4009
# version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
# The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
# Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
# You should have received a copy of the GNU Lesser General Public
Packit 6c4009
# License along with the GNU C Library; if not, see
Packit 6c4009
# <http://www.gnu.org/licenses/>.
Packit 6c4009
Packit 6c4009
set -e
Packit 6c4009
Packit 6c4009
common_objpfx=$1; shift
Packit 6c4009
test_program_prefix=$1; shift
Packit 6c4009
Packit 6c4009
status=0
Packit 6c4009
Packit 6c4009
${test_program_prefix} \
Packit 6c4009
  ${common_objpfx}stdio-common/tst-printf \
Packit 6c4009
  > ${common_objpfx}stdio-common/tst-printf.out || status=1
Packit 6c4009
Packit 6c4009
cat <<'EOF' |
Packit 6c4009
%.4x:	`0012'
Packit 6c4009
%04x:	`0012'
Packit 6c4009
%4.4x:	`0012'
Packit 6c4009
%04.4x:	`0012'
Packit 6c4009
%4.3x:	` 012'
Packit 6c4009
%04.3x:	` 012'
Packit 6c4009
%.*x:	`0012'
Packit 6c4009
%0*x:	`0012'
Packit 6c4009
%*.*x:	`0012'
Packit 6c4009
%0*.*x:	`0012'
Packit 6c4009
bad format:	"%b"
Packit 6c4009
nil pointer (padded):	"     (nil)"
Packit 6c4009
decimal negative:	"-2345"
Packit 6c4009
octal negative:	"37777773327"
Packit 6c4009
hex negative:	"fffff6d7"
Packit 6c4009
long decimal number:	"-123456"
Packit 6c4009
long octal negative:	"37777773327"
Packit 6c4009
long unsigned decimal number:	"4294843840"
Packit 6c4009
zero-padded LDN:	"-000123456"
Packit 6c4009
left-adjusted ZLDN:	"-123456   "
Packit 6c4009
space-padded LDN:	"   -123456"
Packit 6c4009
left-adjusted SLDN:	"-123456   "
Packit 6c4009
zero-padded string:	"    Hi, Z."
Packit 6c4009
left-adjusted Z string:	"Hi, Z.    "
Packit 6c4009
space-padded string:	"    Hi, Z."
Packit 6c4009
left-adjusted S string:	"Hi, Z.    "
Packit 6c4009
null string:	"(null)"
Packit 6c4009
limited string:	"Good morning, Doctor C"
Packit 6c4009
a-style max:	"0x1.fffffffffffffp+1023"
Packit 6c4009
a-style -max:	"-0x1.fffffffffffffp+1023"
Packit 6c4009
e-style >= 1:	"1.234000e+01"
Packit 6c4009
e-style >= .1:	"1.234000e-01"
Packit 6c4009
e-style < .1:	"1.234000e-03"
Packit 6c4009
e-style big:	"1.000000000000000000000000000000000000000000000000000000000000e+20"
Packit 6c4009
e-style == .1:	"1.000000e-01"
Packit 6c4009
f-style >= 1:	"12.340000"
Packit 6c4009
f-style >= .1:	"0.123400"
Packit 6c4009
f-style < .1:	"0.001234"
Packit 6c4009
g-style >= 1:	"12.34"
Packit 6c4009
g-style >= .1:	"0.1234"
Packit 6c4009
g-style < .1:	"0.001234"
Packit 6c4009
g-style big:	"100000000000000000000"
Packit 6c4009
 0.10000
Packit 6c4009
 0.10000
Packit 6c4009
x0.5000x
Packit 6c4009
0x1
Packit 6c4009
something really insane: 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
   4.94066e-324
Packit 6c4009
|      0.0000|  0.0000e+00|           0|
Packit 6c4009
|      1.0000|  1.0000e+00|           1|
Packit 6c4009
|     -1.0000| -1.0000e+00|          -1|
Packit 6c4009
|    100.0000|  1.0000e+02|         100|
Packit 6c4009
|   1000.0000|  1.0000e+03|        1000|
Packit 6c4009
|  10000.0000|  1.0000e+04|       1e+04|
Packit 6c4009
|  12345.0000|  1.2345e+04|   1.234e+04|
Packit 6c4009
| 100000.0000|  1.0000e+05|       1e+05|
Packit 6c4009
| 123456.0000|  1.2346e+05|   1.235e+05|
Packit 6c4009
snprintf ("%30s", "foo") == 30, "                   "
Packit 6c4009
snprintf ("%.999999u", 10) == 999999
Packit 6c4009
179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00000000
Packit 6c4009
-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00000000
Packit 6c4009
1.234568e+06 should be 1.234568e+06
Packit 6c4009
1234567.800000 should be 1234567.800000
Packit 6c4009
1.23457e+06 should be 1.23457e+06
Packit 6c4009
123.456 should be 123.456
Packit 6c4009
1e+06 should be 1e+06
Packit 6c4009
10 should be 10
Packit 6c4009
0.02 should be 0.02
Packit 6c4009
Test ok.
Packit 6c4009
sprintf (buf, "%07Lo", 040000000000ll) = 40000000000
Packit 6c4009
printf ("%hhu", 257) = 1
Packit 6c4009
printf ("%hu", 65537) = 1
Packit 6c4009
printf ("%hhi", 257) = 1
Packit 6c4009
printf ("%hi", 65537) = 1
Packit 6c4009
printf ("%1$hhu", 257) = 1
Packit 6c4009
printf ("%1$hu", 65537) = 1
Packit 6c4009
printf ("%1$hhi", 257) = 1
Packit 6c4009
printf ("%1$hi", 65537) = 1
Packit 6c4009
--- Should be no further output. ---
Packit 6c4009
EOF
Packit 6c4009
cmp - ${common_objpfx}stdio-common/tst-printf.out > /dev/null 2>&1 ||
Packit 6c4009
cat <<'EOF' |
Packit 6c4009
%.4x:	`0012'
Packit 6c4009
%04x:	`0012'
Packit 6c4009
%4.4x:	`0012'
Packit 6c4009
%04.4x:	`0012'
Packit 6c4009
%4.3x:	` 012'
Packit 6c4009
%04.3x:	` 012'
Packit 6c4009
%.*x:	`0012'
Packit 6c4009
%0*x:	`0012'
Packit 6c4009
%*.*x:	`0012'
Packit 6c4009
%0*.*x:	`0012'
Packit 6c4009
bad format:	"%b"
Packit 6c4009
nil pointer (padded):	"     (nil)"
Packit 6c4009
decimal negative:	"-2345"
Packit 6c4009
octal negative:	"37777773327"
Packit 6c4009
hex negative:	"fffff6d7"
Packit 6c4009
long decimal number:	"-123456"
Packit 6c4009
long octal negative:	"1777777777777777773327"
Packit 6c4009
long unsigned decimal number:	"18446744073709428160"
Packit 6c4009
zero-padded LDN:	"-000123456"
Packit 6c4009
left-adjusted ZLDN:	"-123456   "
Packit 6c4009
space-padded LDN:	"   -123456"
Packit 6c4009
left-adjusted SLDN:	"-123456   "
Packit 6c4009
zero-padded string:	"    Hi, Z."
Packit 6c4009
left-adjusted Z string:	"Hi, Z.    "
Packit 6c4009
space-padded string:	"    Hi, Z."
Packit 6c4009
left-adjusted S string:	"Hi, Z.    "
Packit 6c4009
null string:	"(null)"
Packit 6c4009
limited string:	"Good morning, Doctor C"
Packit 6c4009
a-style max:	"0x1.fffffffffffffp+1023"
Packit 6c4009
a-style -max:	"-0x1.fffffffffffffp+1023"
Packit 6c4009
e-style >= 1:	"1.234000e+01"
Packit 6c4009
e-style >= .1:	"1.234000e-01"
Packit 6c4009
e-style < .1:	"1.234000e-03"
Packit 6c4009
e-style big:	"1.000000000000000000000000000000000000000000000000000000000000e+20"
Packit 6c4009
e-style == .1:	"1.000000e-01"
Packit 6c4009
f-style >= 1:	"12.340000"
Packit 6c4009
f-style >= .1:	"0.123400"
Packit 6c4009
f-style < .1:	"0.001234"
Packit 6c4009
g-style >= 1:	"12.34"
Packit 6c4009
g-style >= .1:	"0.1234"
Packit 6c4009
g-style < .1:	"0.001234"
Packit 6c4009
g-style big:	"100000000000000000000"
Packit 6c4009
 0.10000
Packit 6c4009
 0.10000
Packit 6c4009
x0.5000x
Packit 6c4009
0x1
Packit 6c4009
something really insane: 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
5.87747175411143754e-39
Packit 6c4009
   4.94066e-324
Packit 6c4009
|      0.0000|  0.0000e+00|           0|
Packit 6c4009
|      1.0000|  1.0000e+00|           1|
Packit 6c4009
|     -1.0000| -1.0000e+00|          -1|
Packit 6c4009
|    100.0000|  1.0000e+02|         100|
Packit 6c4009
|   1000.0000|  1.0000e+03|        1000|
Packit 6c4009
|  10000.0000|  1.0000e+04|       1e+04|
Packit 6c4009
|  12345.0000|  1.2345e+04|   1.234e+04|
Packit 6c4009
| 100000.0000|  1.0000e+05|       1e+05|
Packit 6c4009
| 123456.0000|  1.2346e+05|   1.235e+05|
Packit 6c4009
snprintf ("%30s", "foo") == 30, "                   "
Packit 6c4009
snprintf ("%.999999u", 10) == 999999
Packit 6c4009
179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00000000
Packit 6c4009
-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00000000
Packit 6c4009
1.234568e+06 should be 1.234568e+06
Packit 6c4009
1234567.800000 should be 1234567.800000
Packit 6c4009
1.23457e+06 should be 1.23457e+06
Packit 6c4009
123.456 should be 123.456
Packit 6c4009
1e+06 should be 1e+06
Packit 6c4009
10 should be 10
Packit 6c4009
0.02 should be 0.02
Packit 6c4009
Test ok.
Packit 6c4009
sprintf (buf, "%07Lo", 040000000000ll) = 40000000000
Packit 6c4009
printf ("%hhu", 257) = 1
Packit 6c4009
printf ("%hu", 65537) = 1
Packit 6c4009
printf ("%hhi", 257) = 1
Packit 6c4009
printf ("%hi", 65537) = 1
Packit 6c4009
printf ("%1$hhu", 257) = 1
Packit 6c4009
printf ("%1$hu", 65537) = 1
Packit 6c4009
printf ("%1$hhi", 257) = 1
Packit 6c4009
printf ("%1$hi", 65537) = 1
Packit 6c4009
--- Should be no further output. ---
Packit 6c4009
EOF
Packit 6c4009
cmp - ${common_objpfx}stdio-common/tst-printf.out > /dev/null 2>&1 ||
Packit 6c4009
{
Packit 6c4009
  status=1
Packit 6c4009
  echo "*** output comparison failed"
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
exit $status