.
[kopensolaris-gnu/glibc.git] / stdio-common / tst-printf.sh
1 #! /bin/sh
2 # Testing of printf.
3 # Copyright (C) 2000, 2002 Free Software Foundation, Inc.
4 # This file is part of the GNU C Library.
5 #
6
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.
11
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.
16
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.
21
22 common_objpfx=$1; shift
23 run_program_prefix=$1; shift
24
25 status=0
26
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
31
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) == 999999
107
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 Test ok.
136 sprintf (buf, "%07Lo", 040000000000ll) = 40000000000
137 printf ("%hhu", 257) = 1
138 printf ("%hu", 65537) = 1
139 --- Should be no further output. ---
140 EOF
141 cmp - ${common_objpfx}stdio-common/tst-printf.out > /dev/null 2>&1 ||
142 cat <<'EOF' |
143 %.4x:   `0012'
144 %04x:   `0012'
145 %4.4x:  `0012'
146 %04.4x: `0012'
147 %4.3x:  ` 012'
148 %04.3x: ` 012'
149 %.*x:   `0012'
150 %0*x:   `0012'
151 %*.*x:  `0012'
152 %0*.*x: `0012'
153 bad format:     "%b"
154 nil pointer (padded):   "     (nil)"
155 decimal negative:       "-2345"
156 octal negative: "37777773327"
157 hex negative:   "fffff6d7"
158 long decimal number:    "-123456"
159 long octal negative:    "1777777777777777773327"
160 long unsigned decimal number:   "18446744073709428160"
161 zero-padded LDN:        "-000123456"
162 left-adjusted ZLDN:     "-123456   "
163 space-padded LDN:       "   -123456"
164 left-adjusted SLDN:     "-123456   "
165 zero-padded string:     "    Hi, Z."
166 left-adjusted Z string: "Hi, Z.    "
167 space-padded string:    "    Hi, Z."
168 left-adjusted S string: "Hi, Z.    "
169 null string:    "(null)"
170 limited string: "Good morning, Doctor C"
171 e-style >= 1:   "1.234000e+01"
172 e-style >= .1:  "1.234000e-01"
173 e-style < .1:   "1.234000e-03"
174 e-style big:    "1.000000000000000000000000000000000000000000000000000000000000e+20"
175 e-style == .1:  "1.000000e-01"
176 f-style >= 1:   "12.340000"
177 f-style >= .1:  "0.123400"
178 f-style < .1:   "0.001234"
179 g-style >= 1:   "12.34"
180 g-style >= .1:  "0.1234"
181 g-style < .1:   "0.001234"
182 g-style big:    "100000000000000000000"
183  0.10000
184  0.10000
185 x0.5000x
186 0x1
187 something really insane: 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
188 5.87747175411143754e-39
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    4.94066e-324
206 |      0.0000|  0.0000e+00|           0|
207 |      1.0000|  1.0000e+00|           1|
208 |     -1.0000| -1.0000e+00|          -1|
209 |    100.0000|  1.0000e+02|         100|
210 |   1000.0000|  1.0000e+03|        1000|
211 |  10000.0000|  1.0000e+04|       1e+04|
212 |  12345.0000|  1.2345e+04|   1.234e+04|
213 | 100000.0000|  1.0000e+05|       1e+05|
214 | 123456.0000|  1.2346e+05|   1.235e+05|
215 snprintf ("%30s", "foo") == 30, "                   "
216 snprintf ("%.999999u", 10) == 999999
217
218 Formatted output test
219 prefix  6d      6o      6x      6X      6u
220 %-+#0 |-123   |0377   |0xff   |0XFF   |4294967295 |
221  %-+# |-123   |0377   |0xff   |0XFF   |4294967295 |
222  %-+0 |-123   |377    |ff     |FF     |4294967295 |
223   %-+ |-123   |377    |ff     |FF     |4294967295 |
224  %-#0 |-123   |0377   |0xff   |0XFF   |4294967295 |
225   %-# |-123   |0377   |0xff   |0XFF   |4294967295 |
226   %-0 |-123   |377    |ff     |FF     |4294967295 |
227    %- |-123   |377    |ff     |FF     |4294967295 |
228  %+#0 |-00123 |000377 |0x00ff |0X00FF |4294967295 |
229   %+# |  -123 |  0377 |  0xff |  0XFF |4294967295 |
230   %+0 |-00123 |000377 |0000ff |0000FF |4294967295 |
231    %+ |  -123 |   377 |    ff |    FF |4294967295 |
232   %#0 |-00123 |000377 |0x00ff |0X00FF |4294967295 |
233    %# |  -123 |  0377 |  0xff |  0XFF |4294967295 |
234    %0 |-00123 |000377 |0000ff |0000FF |4294967295 |
235     % |  -123 |   377 |    ff |    FF |4294967295 |
236     (null)
237 (null)    
238 1.234568e+06 should be 1.234568e+06
239 1234567.800000 should be 1234567.800000
240 1.23457e+06 should be 1.23457e+06
241 123.456 should be 123.456
242 1e+06 should be 1e+06
243 10 should be 10
244 0.02 should be 0.02
245 Test ok.
246 sprintf (buf, "%07Lo", 040000000000ll) = 40000000000
247 printf ("%hhu", 257) = 1
248 printf ("%hu", 65537) = 1
249 --- Should be no further output. ---
250 EOF
251 cmp - ${common_objpfx}stdio-common/tst-printf.out > /dev/null 2>&1 ||
252 {
253   status=1
254   echo "*** output comparison failed"
255 }
256
257 exit $status