Update copyright dates with scripts/update-copyrights.
[glibc.git] / stdio-common / tst-printf.sh
blobf4ae5e437080b52977c92f3cbc4bd3422685b8d5
1 #! /bin/sh
2 # Testing of printf.
3 # Copyright (C) 2000-2015 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/>.
20 set -e
22 common_objpfx=$1; shift
23 test_program_prefix=$1; shift
25 status=0
27 ${test_program_prefix} \
28 ${common_objpfx}stdio-common/tst-printf \
29 > ${common_objpfx}stdio-common/tst-printf.out || status=1
31 cat <<'EOF' |
32 %.4x: `0012'
33 %04x: `0012'
34 %4.4x: `0012'
35 %04.4x: `0012'
36 %4.3x: ` 012'
37 %04.3x: ` 012'
38 %.*x: `0012'
39 %0*x: `0012'
40 %*.*x: `0012'
41 %0*.*x: `0012'
42 bad format: "%b"
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. "
58 null string: "(null)"
59 limited string: "Good morning, Doctor C"
60 e-style >= 1: "1.234000e+01"
61 e-style >= .1: "1.234000e-01"
62 e-style < .1: "1.234000e-03"
63 e-style big: "1.000000000000000000000000000000000000000000000000000000000000e+20"
64 e-style == .1: "1.000000e-01"
65 f-style >= 1: "12.340000"
66 f-style >= .1: "0.123400"
67 f-style < .1: "0.001234"
68 g-style >= 1: "12.34"
69 g-style >= .1: "0.1234"
70 g-style < .1: "0.001234"
71 g-style big: "100000000000000000000"
72 0.10000
73 0.10000
74 x0.5000x
75 0x1
76 something really insane: 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
77 5.87747175411143754e-39
78 5.87747175411143754e-39
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 4.94066e-324
95 | 0.0000| 0.0000e+00| 0|
96 | 1.0000| 1.0000e+00| 1|
97 | -1.0000| -1.0000e+00| -1|
98 | 100.0000| 1.0000e+02| 100|
99 | 1000.0000| 1.0000e+03| 1000|
100 | 10000.0000| 1.0000e+04| 1e+04|
101 | 12345.0000| 1.2345e+04| 1.234e+04|
102 | 100000.0000| 1.0000e+05| 1e+05|
103 | 123456.0000| 1.2346e+05| 1.235e+05|
104 snprintf ("%30s", "foo") == 30, " "
105 snprintf ("%.999999u", 10) == 999999
107 Formatted output test
108 prefix 6d 6o 6x 6X 6u
109 %-+#0 |-123 |0377 |0xff |0XFF |4294967295 |
110 %-+# |-123 |0377 |0xff |0XFF |4294967295 |
111 %-+0 |-123 |377 |ff |FF |4294967295 |
112 %-+ |-123 |377 |ff |FF |4294967295 |
113 %-#0 |-123 |0377 |0xff |0XFF |4294967295 |
114 %-# |-123 |0377 |0xff |0XFF |4294967295 |
115 %-0 |-123 |377 |ff |FF |4294967295 |
116 %- |-123 |377 |ff |FF |4294967295 |
117 %+#0 |-00123 |000377 |0x00ff |0X00FF |4294967295 |
118 %+# | -123 | 0377 | 0xff | 0XFF |4294967295 |
119 %+0 |-00123 |000377 |0000ff |0000FF |4294967295 |
120 %+ | -123 | 377 | ff | FF |4294967295 |
121 %#0 |-00123 |000377 |0x00ff |0X00FF |4294967295 |
122 %# | -123 | 0377 | 0xff | 0XFF |4294967295 |
123 %0 |-00123 |000377 |0000ff |0000FF |4294967295 |
124 % | -123 | 377 | ff | FF |4294967295 |
125 (null)
126 (null)
127 1.234568e+06 should be 1.234568e+06
128 1234567.800000 should be 1234567.800000
129 1.23457e+06 should be 1.23457e+06
130 123.456 should be 123.456
131 1e+06 should be 1e+06
132 10 should be 10
133 0.02 should be 0.02
134 Test ok.
135 sprintf (buf, "%07Lo", 040000000000ll) = 40000000000
136 printf ("%hhu", 257) = 1
137 printf ("%hu", 65537) = 1
138 printf ("%hhi", 257) = 1
139 printf ("%hi", 65537) = 1
140 printf ("%1$hhu", 257) = 1
141 printf ("%1$hu", 65537) = 1
142 printf ("%1$hhi", 257) = 1
143 printf ("%1$hi", 65537) = 1
144 --- Should be no further output. ---
146 cmp - ${common_objpfx}stdio-common/tst-printf.out > /dev/null 2>&1 ||
147 cat <<'EOF' |
148 %.4x: `0012'
149 %04x: `0012'
150 %4.4x: `0012'
151 %04.4x: `0012'
152 %4.3x: ` 012'
153 %04.3x: ` 012'
154 %.*x: `0012'
155 %0*x: `0012'
156 %*.*x: `0012'
157 %0*.*x: `0012'
158 bad format: "%b"
159 nil pointer (padded): " (nil)"
160 decimal negative: "-2345"
161 octal negative: "37777773327"
162 hex negative: "fffff6d7"
163 long decimal number: "-123456"
164 long octal negative: "1777777777777777773327"
165 long unsigned decimal number: "18446744073709428160"
166 zero-padded LDN: "-000123456"
167 left-adjusted ZLDN: "-123456 "
168 space-padded LDN: " -123456"
169 left-adjusted SLDN: "-123456 "
170 zero-padded string: " Hi, Z."
171 left-adjusted Z string: "Hi, Z. "
172 space-padded string: " Hi, Z."
173 left-adjusted S string: "Hi, Z. "
174 null string: "(null)"
175 limited string: "Good morning, Doctor C"
176 e-style >= 1: "1.234000e+01"
177 e-style >= .1: "1.234000e-01"
178 e-style < .1: "1.234000e-03"
179 e-style big: "1.000000000000000000000000000000000000000000000000000000000000e+20"
180 e-style == .1: "1.000000e-01"
181 f-style >= 1: "12.340000"
182 f-style >= .1: "0.123400"
183 f-style < .1: "0.001234"
184 g-style >= 1: "12.34"
185 g-style >= .1: "0.1234"
186 g-style < .1: "0.001234"
187 g-style big: "100000000000000000000"
188 0.10000
189 0.10000
190 x0.5000x
192 something really insane: 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
193 5.87747175411143754e-39
194 5.87747175411143754e-39
195 5.87747175411143754e-39
196 5.87747175411143754e-39
197 5.87747175411143754e-39
198 5.87747175411143754e-39
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 4.94066e-324
211 | 0.0000| 0.0000e+00| 0|
212 | 1.0000| 1.0000e+00| 1|
213 | -1.0000| -1.0000e+00| -1|
214 | 100.0000| 1.0000e+02| 100|
215 | 1000.0000| 1.0000e+03| 1000|
216 | 10000.0000| 1.0000e+04| 1e+04|
217 | 12345.0000| 1.2345e+04| 1.234e+04|
218 | 100000.0000| 1.0000e+05| 1e+05|
219 | 123456.0000| 1.2346e+05| 1.235e+05|
220 snprintf ("%30s", "foo") == 30, " "
221 snprintf ("%.999999u", 10) == 999999
223 Formatted output test
224 prefix 6d 6o 6x 6X 6u
225 %-+#0 |-123 |0377 |0xff |0XFF |4294967295 |
226 %-+# |-123 |0377 |0xff |0XFF |4294967295 |
227 %-+0 |-123 |377 |ff |FF |4294967295 |
228 %-+ |-123 |377 |ff |FF |4294967295 |
229 %-#0 |-123 |0377 |0xff |0XFF |4294967295 |
230 %-# |-123 |0377 |0xff |0XFF |4294967295 |
231 %-0 |-123 |377 |ff |FF |4294967295 |
232 %- |-123 |377 |ff |FF |4294967295 |
233 %+#0 |-00123 |000377 |0x00ff |0X00FF |4294967295 |
234 %+# | -123 | 0377 | 0xff | 0XFF |4294967295 |
235 %+0 |-00123 |000377 |0000ff |0000FF |4294967295 |
236 %+ | -123 | 377 | ff | FF |4294967295 |
237 %#0 |-00123 |000377 |0x00ff |0X00FF |4294967295 |
238 %# | -123 | 0377 | 0xff | 0XFF |4294967295 |
239 %0 |-00123 |000377 |0000ff |0000FF |4294967295 |
240 % | -123 | 377 | ff | FF |4294967295 |
241 (null)
242 (null)
243 1.234568e+06 should be 1.234568e+06
244 1234567.800000 should be 1234567.800000
245 1.23457e+06 should be 1.23457e+06
246 123.456 should be 123.456
247 1e+06 should be 1e+06
248 10 should be 10
249 0.02 should be 0.02
250 Test ok.
251 sprintf (buf, "%07Lo", 040000000000ll) = 40000000000
252 printf ("%hhu", 257) = 1
253 printf ("%hu", 65537) = 1
254 printf ("%hhi", 257) = 1
255 printf ("%hi", 65537) = 1
256 printf ("%1$hhu", 257) = 1
257 printf ("%1$hu", 65537) = 1
258 printf ("%1$hhi", 257) = 1
259 printf ("%1$hi", 65537) = 1
260 --- Should be no further output. ---
262 cmp - ${common_objpfx}stdio-common/tst-printf.out > /dev/null 2>&1 ||
264 status=1
265 echo "*** output comparison failed"
268 exit $status