3 # Copyright (C) 2000-2018 Free Software Foundation, Inc.
4 # This file is part of the GNU C Library.
6 # The GNU C Library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
11 # The GNU C Library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with the GNU C Library; if not, see
18 # <http://www.gnu.org/licenses/>.
22 common_objpfx
=$1; shift
23 test_program_prefix
=$1; shift
27 ${test_program_prefix} \
28 ${common_objpfx}stdio-common
/tst-printf \
29 > ${common_objpfx}stdio-common
/tst-printf.out || status
=1
43 nil pointer (padded): " (nil)"
44 decimal negative: "-2345"
45 octal negative: "37777773327"
46 hex negative: "fffff6d7"
47 long decimal number: "-123456"
48 long octal negative: "37777773327"
49 long unsigned decimal number: "4294843840"
50 zero-padded LDN: "-000123456"
51 left-adjusted ZLDN: "-123456 "
52 space-padded LDN: " -123456"
53 left-adjusted SLDN: "-123456 "
54 zero-padded string: " Hi, Z."
55 left-adjusted Z string: "Hi, Z. "
56 space-padded string: " Hi, Z."
57 left-adjusted S string: "Hi, Z. "
59 limited string: "Good morning, Doctor C"
60 a-style max: "0x1.fffffffffffffp+1023"
61 a-style -max: "-0x1.fffffffffffffp+1023"
62 e-style >= 1: "1.234000e+01"
63 e-style >= .1: "1.234000e-01"
64 e-style < .1: "1.234000e-03"
65 e-style big: "1.000000000000000000000000000000000000000000000000000000000000e+20"
66 e-style == .1: "1.000000e-01"
67 f-style >= 1: "12.340000"
68 f-style >= .1: "0.123400"
69 f-style < .1: "0.001234"
71 g-style >= .1: "0.1234"
72 g-style < .1: "0.001234"
73 g-style big: "100000000000000000000"
78 something really insane: 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
79 5.87747175411143754e-39
80 5.87747175411143754e-39
81 5.87747175411143754e-39
82 5.87747175411143754e-39
83 5.87747175411143754e-39
84 5.87747175411143754e-39
85 5.87747175411143754e-39
86 5.87747175411143754e-39
87 5.87747175411143754e-39
88 5.87747175411143754e-39
89 5.87747175411143754e-39
90 5.87747175411143754e-39
91 5.87747175411143754e-39
92 5.87747175411143754e-39
93 5.87747175411143754e-39
94 5.87747175411143754e-39
95 5.87747175411143754e-39
97 | 0.0000| 0.0000e+00| 0|
98 | 1.0000| 1.0000e+00| 1|
99 | -1.0000| -1.0000e+00| -1|
100 | 100.0000| 1.0000e+02| 100|
101 | 1000.0000| 1.0000e+03| 1000|
102 | 10000.0000| 1.0000e+04| 1e+04|
103 | 12345.0000| 1.2345e+04| 1.234e+04|
104 | 100000.0000| 1.0000e+05| 1e+05|
105 | 123456.0000| 1.2346e+05| 1.235e+05|
106 snprintf ("%30s", "foo") == 30, " "
107 snprintf ("%.999999u", 10) == 999999
109 Formatted output test
110 prefix 6d 6o 6x 6X 6u
111 %-+#0 |-123 |0377 |0xff |0XFF |4294967295 |
112 %-+# |-123 |0377 |0xff |0XFF |4294967295 |
113 %-+0 |-123 |377 |ff |FF |4294967295 |
114 %-+ |-123 |377 |ff |FF |4294967295 |
115 %-#0 |-123 |0377 |0xff |0XFF |4294967295 |
116 %-# |-123 |0377 |0xff |0XFF |4294967295 |
117 %-0 |-123 |377 |ff |FF |4294967295 |
118 %- |-123 |377 |ff |FF |4294967295 |
119 %+#0 |-00123 |000377 |0x00ff |0X00FF |4294967295 |
120 %+# | -123 | 0377 | 0xff | 0XFF |4294967295 |
121 %+0 |-00123 |000377 |0000ff |0000FF |4294967295 |
122 %+ | -123 | 377 | ff | FF |4294967295 |
123 %#0 |-00123 |000377 |0x00ff |0X00FF |4294967295 |
124 %# | -123 | 0377 | 0xff | 0XFF |4294967295 |
125 %0 |-00123 |000377 |0000ff |0000FF |4294967295 |
126 % | -123 | 377 | ff | FF |4294967295 |
129 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00000000
130 -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00000000
131 1.234568e+06 should be 1.234568e+06
132 1234567.800000 should be 1234567.800000
133 1.23457e+06 should be 1.23457e+06
134 123.456 should be 123.456
135 1e+06 should be 1e+06
139 sprintf (buf, "%07Lo", 040000000000ll) = 40000000000
140 printf ("%hhu", 257) = 1
141 printf ("%hu", 65537) = 1
142 printf ("%hhi", 257) = 1
143 printf ("%hi", 65537) = 1
144 printf ("%1$hhu", 257) = 1
145 printf ("%1$hu", 65537) = 1
146 printf ("%1$hhi", 257) = 1
147 printf ("%1$hi", 65537) = 1
148 --- Should be no further output. ---
150 cmp - ${common_objpfx}stdio-common
/tst-printf.out
> /dev
/null
2>&1 ||
163 nil pointer (padded): " (nil)"
164 decimal negative: "-2345"
165 octal negative: "37777773327"
166 hex negative: "fffff6d7"
167 long decimal number: "-123456"
168 long octal negative: "1777777777777777773327"
169 long unsigned decimal number: "18446744073709428160"
170 zero-padded LDN: "-000123456"
171 left-adjusted ZLDN: "-123456 "
172 space-padded LDN: " -123456"
173 left-adjusted SLDN: "-123456 "
174 zero-padded string: " Hi, Z."
175 left-adjusted Z string: "Hi, Z. "
176 space-padded string: " Hi, Z."
177 left-adjusted S string: "Hi, Z. "
178 null string: "(null)"
179 limited string: "Good morning, Doctor C"
180 a-style max: "0x1.fffffffffffffp+1023"
181 a-style -max: "-0x1.fffffffffffffp+1023"
182 e-style >= 1: "1.234000e+01"
183 e-style >= .1: "1.234000e-01"
184 e-style < .1: "1.234000e-03"
185 e-style big: "1.000000000000000000000000000000000000000000000000000000000000e+20"
186 e-style == .1: "1.000000e-01"
187 f-style >= 1: "12.340000"
188 f-style >= .1: "0.123400"
189 f-style < .1: "0.001234"
190 g-style >= 1: "12.34"
191 g-style >= .1: "0.1234"
192 g-style < .1: "0.001234"
193 g-style big: "100000000000000000000"
198 something really insane: 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
199 5.87747175411143754e-39
200 5.87747175411143754e-39
201 5.87747175411143754e-39
202 5.87747175411143754e-39
203 5.87747175411143754e-39
204 5.87747175411143754e-39
205 5.87747175411143754e-39
206 5.87747175411143754e-39
207 5.87747175411143754e-39
208 5.87747175411143754e-39
209 5.87747175411143754e-39
210 5.87747175411143754e-39
211 5.87747175411143754e-39
212 5.87747175411143754e-39
213 5.87747175411143754e-39
214 5.87747175411143754e-39
215 5.87747175411143754e-39
217 | 0.0000| 0.0000e+00| 0|
218 | 1.0000| 1.0000e+00| 1|
219 | -1.0000| -1.0000e+00| -1|
220 | 100.0000| 1.0000e+02| 100|
221 | 1000.0000| 1.0000e+03| 1000|
222 | 10000.0000| 1.0000e+04| 1e+04|
223 | 12345.0000| 1.2345e+04| 1.234e+04|
224 | 100000.0000| 1.0000e+05| 1e+05|
225 | 123456.0000| 1.2346e+05| 1.235e+05|
226 snprintf ("%30s", "foo") == 30, " "
227 snprintf ("%.999999u", 10) == 999999
229 Formatted output test
230 prefix 6d 6o 6x 6X 6u
231 %-+#0 |-123 |0377 |0xff |0XFF |4294967295 |
232 %-+# |-123 |0377 |0xff |0XFF |4294967295 |
233 %-+0 |-123 |377 |ff |FF |4294967295 |
234 %-+ |-123 |377 |ff |FF |4294967295 |
235 %-#0 |-123 |0377 |0xff |0XFF |4294967295 |
236 %-# |-123 |0377 |0xff |0XFF |4294967295 |
237 %-0 |-123 |377 |ff |FF |4294967295 |
238 %- |-123 |377 |ff |FF |4294967295 |
239 %+#0 |-00123 |000377 |0x00ff |0X00FF |4294967295 |
240 %+# | -123 | 0377 | 0xff | 0XFF |4294967295 |
241 %+0 |-00123 |000377 |0000ff |0000FF |4294967295 |
242 %+ | -123 | 377 | ff | FF |4294967295 |
243 %#0 |-00123 |000377 |0x00ff |0X00FF |4294967295 |
244 %# | -123 | 0377 | 0xff | 0XFF |4294967295 |
245 %0 |-00123 |000377 |0000ff |0000FF |4294967295 |
246 % | -123 | 377 | ff | FF |4294967295 |
249 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00000000
250 -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00000000
251 1.234568e+06 should be 1.234568e+06
252 1234567.800000 should be 1234567.800000
253 1.23457e+06 should be 1.23457e+06
254 123.456 should be 123.456
255 1e+06 should be 1e+06
259 sprintf (buf, "%07Lo", 040000000000ll) = 40000000000
260 printf ("%hhu", 257) = 1
261 printf ("%hu", 65537) = 1
262 printf ("%hhi", 257) = 1
263 printf ("%hi", 65537) = 1
264 printf ("%1$hhu", 257) = 1
265 printf ("%1$hu", 65537) = 1
266 printf ("%1$hhi", 257) = 1
267 printf ("%1$hi", 65537) = 1
268 --- Should be no further output. ---
270 cmp - ${common_objpfx}stdio-common
/tst-printf.out
> /dev
/null
2>&1 ||
273 echo "*** output comparison failed"