(atomic_add): Don't allow address register for operand 0.
[glibc.git] / stdio-common / tst-printf.sh
blobe207f639ba6db4824747709e7aecfd8807aeee25
1 #! /bin/sh
2 # Testing of printf.
3 # Copyright (C) 2000 Free Software Foundation, Inc.
4 # This file is part of the GNU C Library.
7 # The GNU C Library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
12 # The GNU C Library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with the GNU C Library; if not, write to the Free
19 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 # 02111-1307 USA.
22 common_objpfx=$1; shift
23 run_program_prefix=$1; shift
25 status=0
27 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
28 ${run_program_prefix} \
29 ${common_objpfx}stdio-common/tst-printf \
30 > ${common_objpfx}stdio-common/tst-printf.out || status=1
32 cat <<'EOF' |
33 %.4x: `0012'
34 %04x: `0012'
35 %4.4x: `0012'
36 %04.4x: `0012'
37 %4.3x: ` 012'
38 %04.3x: ` 012'
39 %.*x: `0012'
40 %0*x: `0012'
41 %*.*x: `0012'
42 %0*.*x: `0012'
43 bad format: "%b"
44 nil pointer (padded): " (nil)"
45 decimal negative: "-2345"
46 octal negative: "37777773327"
47 hex negative: "fffff6d7"
48 long decimal number: "-123456"
49 long octal negative: "37777773327"
50 long unsigned decimal number: "4294843840"
51 zero-padded LDN: "-000123456"
52 left-adjusted ZLDN: "-123456 "
53 space-padded LDN: " -123456"
54 left-adjusted SLDN: "-123456 "
55 zero-padded string: " Hi, Z."
56 left-adjusted Z string: "Hi, Z. "
57 space-padded string: " Hi, Z."
58 left-adjusted S string: "Hi, Z. "
59 null string: "(null)"
60 limited string: "Good morning, Doctor C"
61 e-style >= 1: "1.234000e+01"
62 e-style >= .1: "1.234000e-01"
63 e-style < .1: "1.234000e-03"
64 e-style big: "1.000000000000000000000000000000000000000000000000000000000000e+20"
65 e-style == .1: "1.000000e-01"
66 f-style >= 1: "12.340000"
67 f-style >= .1: "0.123400"
68 f-style < .1: "0.001234"
69 g-style >= 1: "12.34"
70 g-style >= .1: "0.1234"
71 g-style < .1: "0.001234"
72 g-style big: "100000000000000000000"
73 0.10000
74 0.10000
75 x0.5000x
76 0x1
77 something really insane: 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
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 5.87747175411143754e-39
95 4.94066e-324
96 | 0.0000| 0.0000e+00| 0|
97 | 1.0000| 1.0000e+00| 1|
98 | -1.0000| -1.0000e+00| -1|
99 | 100.0000| 1.0000e+02| 100|
100 | 1000.0000| 1.0000e+03| 1000|
101 | 10000.0000| 1.0000e+04| 1e+04|
102 | 12345.0000| 1.2345e+04| 1.234e+04|
103 | 100000.0000| 1.0000e+05| 1e+05|
104 | 123456.0000| 1.2346e+05| 1.235e+05|
105 snprintf ("%30s", "foo") == 30, " "
106 snprintf ("%.999999u", 10)
108 Formatted output test
109 prefix 6d 6o 6x 6X 6u
110 %-+#0 |-123 |0377 |0xff |0XFF |4294967295 |
111 %-+# |-123 |0377 |0xff |0XFF |4294967295 |
112 %-+0 |-123 |377 |ff |FF |4294967295 |
113 %-+ |-123 |377 |ff |FF |4294967295 |
114 %-#0 |-123 |0377 |0xff |0XFF |4294967295 |
115 %-# |-123 |0377 |0xff |0XFF |4294967295 |
116 %-0 |-123 |377 |ff |FF |4294967295 |
117 %- |-123 |377 |ff |FF |4294967295 |
118 %+#0 |-00123 |000377 |0x00ff |0X00FF |4294967295 |
119 %+# | -123 | 0377 | 0xff | 0XFF |4294967295 |
120 %+0 |-00123 |000377 |0000ff |0000FF |4294967295 |
121 %+ | -123 | 377 | ff | FF |4294967295 |
122 %#0 |-00123 |000377 |0x00ff |0X00FF |4294967295 |
123 %# | -123 | 0377 | 0xff | 0XFF |4294967295 |
124 %0 |-00123 |000377 |0000ff |0000FF |4294967295 |
125 % | -123 | 377 | ff | FF |4294967295 |
126 (null)
127 (null)
128 1.234568e+06 should be 1.234568e+06
129 1234567.800000 should be 1234567.800000
130 1.23457e+06 should be 1.23457e+06
131 123.456 should be 123.456
132 1e+06 should be 1e+06
133 10 should be 10
134 0.02 should be 0.02
135 0.10000000000000009
136 Test ok.
137 sprintf (buf, "%07Lo", 040000000000ll) = 40000000000
138 printf ("%hhu", 257) = 1
139 printf ("%hu", 65537) = 1
140 --- Should be no further output. ---
142 cmp - ${common_objpfx}stdio-common/tst-printf.out > /dev/null 2>&1 ||
143 cat <<'EOF' |
144 %.4x: `0012'
145 %04x: `0012'
146 %4.4x: `0012'
147 %04.4x: `0012'
148 %4.3x: ` 012'
149 %04.3x: ` 012'
150 %.*x: `0012'
151 %0*x: `0012'
152 %*.*x: `0012'
153 %0*.*x: `0012'
154 bad format: "%b"
155 nil pointer (padded): " (nil)"
156 decimal negative: "-2345"
157 octal negative: "37777773327"
158 hex negative: "fffff6d7"
159 long decimal number: "-123456"
160 long octal negative: "1777777777777777773327"
161 long unsigned decimal number: "18446744073709428160"
162 zero-padded LDN: "-000123456"
163 left-adjusted ZLDN: "-123456 "
164 space-padded LDN: " -123456"
165 left-adjusted SLDN: "-123456 "
166 zero-padded string: " Hi, Z."
167 left-adjusted Z string: "Hi, Z. "
168 space-padded string: " Hi, Z."
169 left-adjusted S string: "Hi, Z. "
170 null string: "(null)"
171 limited string: "Good morning, Doctor C"
172 e-style >= 1: "1.234000e+01"
173 e-style >= .1: "1.234000e-01"
174 e-style < .1: "1.234000e-03"
175 e-style big: "1.000000000000000000000000000000000000000000000000000000000000e+20"
176 e-style == .1: "1.000000e-01"
177 f-style >= 1: "12.340000"
178 f-style >= .1: "0.123400"
179 f-style < .1: "0.001234"
180 g-style >= 1: "12.34"
181 g-style >= .1: "0.1234"
182 g-style < .1: "0.001234"
183 g-style big: "100000000000000000000"
184 0.10000
185 0.10000
186 x0.5000x
188 something really insane: 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
189 5.87747175411143754e-39
190 5.87747175411143754e-39
191 5.87747175411143754e-39
192 5.87747175411143754e-39
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 4.94066e-324
207 | 0.0000| 0.0000e+00| 0|
208 | 1.0000| 1.0000e+00| 1|
209 | -1.0000| -1.0000e+00| -1|
210 | 100.0000| 1.0000e+02| 100|
211 | 1000.0000| 1.0000e+03| 1000|
212 | 10000.0000| 1.0000e+04| 1e+04|
213 | 12345.0000| 1.2345e+04| 1.234e+04|
214 | 100000.0000| 1.0000e+05| 1e+05|
215 | 123456.0000| 1.2346e+05| 1.235e+05|
216 snprintf ("%30s", "foo") == 30, " "
217 snprintf ("%.999999u", 10)
219 Formatted output test
220 prefix 6d 6o 6x 6X 6u
221 %-+#0 |-123 |0377 |0xff |0XFF |4294967295 |
222 %-+# |-123 |0377 |0xff |0XFF |4294967295 |
223 %-+0 |-123 |377 |ff |FF |4294967295 |
224 %-+ |-123 |377 |ff |FF |4294967295 |
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 |-00123 |000377 |0x00ff |0X00FF |4294967295 |
230 %+# | -123 | 0377 | 0xff | 0XFF |4294967295 |
231 %+0 |-00123 |000377 |0000ff |0000FF |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 (null)
238 (null)
239 1.234568e+06 should be 1.234568e+06
240 1234567.800000 should be 1234567.800000
241 1.23457e+06 should be 1.23457e+06
242 123.456 should be 123.456
243 1e+06 should be 1e+06
244 10 should be 10
245 0.02 should be 0.02
246 0.10000000000000009
247 Test ok.
248 sprintf (buf, "%07Lo", 040000000000ll) = 40000000000
249 printf ("%hhu", 257) = 1
250 printf ("%hu", 65537) = 1
251 --- Should be no further output. ---
253 cmp - ${common_objpfx}stdio-common/tst-printf.out > /dev/null 2>&1 ||
255 status=1
256 echo "*** output comparison failed"
259 exit $status