]>
Commit | Line | Data |
---|---|---|
48d0341c | 1 | #!/bin/sh |
0755050e | 2 | # Testing of printf. |
2b778ceb | 3 | # Copyright (C) 2000-2021 Free Software Foundation, Inc. |
0755050e | 4 | # This file is part of the GNU C Library. |
41bdb6e2 | 5 | |
0755050e | 6 | # The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
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. | |
10 | ||
0755050e UD |
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 | |
41bdb6e2 AJ |
14 | # Lesser General Public License for more details. |
15 | ||
16 | # You should have received a copy of the GNU Lesser General Public | |
59ba27a6 | 17 | # License along with the GNU C Library; if not, see |
5a82c748 | 18 | # <https://www.gnu.org/licenses/>. |
0755050e | 19 | |
57c69bef DL |
20 | set -e |
21 | ||
0755050e | 22 | common_objpfx=$1; shift |
740b3dbe | 23 | test_program_prefix=$1; shift |
0755050e UD |
24 | |
25 | status=0 | |
26 | ||
740b3dbe | 27 | ${test_program_prefix} \ |
0755050e UD |
28 | ${common_objpfx}stdio-common/tst-printf \ |
29 | > ${common_objpfx}stdio-common/tst-printf.out || status=1 | |
30 | ||
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" | |
179dcdb7 TMQMF |
60 | a-style max: "0x1.fffffffffffffp+1023" |
61 | a-style -max: "-0x1.fffffffffffffp+1023" | |
0755050e UD |
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" | |
70 | g-style >= 1: "12.34" | |
71 | g-style >= .1: "0.1234" | |
72 | g-style < .1: "0.001234" | |
73 | g-style big: "100000000000000000000" | |
74 | 0.10000 | |
75 | 0.10000 | |
76 | x0.5000x | |
77 | 0x1 | |
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 | |
96 | 4.94066e-324 | |
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, " " | |
351f0765 | 107 | snprintf ("%.999999u", 10) == 999999 |
179dcdb7 TMQMF |
108 | 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00000000 |
109 | -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00000000 | |
0755050e UD |
110 | 1.234568e+06 should be 1.234568e+06 |
111 | 1234567.800000 should be 1234567.800000 | |
112 | 1.23457e+06 should be 1.23457e+06 | |
113 | 123.456 should be 123.456 | |
114 | 1e+06 should be 1e+06 | |
115 | 10 should be 10 | |
116 | 0.02 should be 0.02 | |
0755050e UD |
117 | Test ok. |
118 | sprintf (buf, "%07Lo", 040000000000ll) = 40000000000 | |
655de5fd UD |
119 | printf ("%hhu", 257) = 1 |
120 | printf ("%hu", 65537) = 1 | |
fff04b32 UD |
121 | printf ("%hhi", 257) = 1 |
122 | printf ("%hi", 65537) = 1 | |
123 | printf ("%1$hhu", 257) = 1 | |
124 | printf ("%1$hu", 65537) = 1 | |
125 | printf ("%1$hhi", 257) = 1 | |
126 | printf ("%1$hi", 65537) = 1 | |
0755050e UD |
127 | --- Should be no further output. --- |
128 | EOF | |
1746f2b0 | 129 | cmp - ${common_objpfx}stdio-common/tst-printf.out > /dev/null 2>&1 || |
2a82441b UD |
130 | cat <<'EOF' | |
131 | %.4x: `0012' | |
132 | %04x: `0012' | |
133 | %4.4x: `0012' | |
134 | %04.4x: `0012' | |
135 | %4.3x: ` 012' | |
136 | %04.3x: ` 012' | |
137 | %.*x: `0012' | |
138 | %0*x: `0012' | |
139 | %*.*x: `0012' | |
140 | %0*.*x: `0012' | |
141 | bad format: "%b" | |
142 | nil pointer (padded): " (nil)" | |
143 | decimal negative: "-2345" | |
144 | octal negative: "37777773327" | |
145 | hex negative: "fffff6d7" | |
146 | long decimal number: "-123456" | |
147 | long octal negative: "1777777777777777773327" | |
148 | long unsigned decimal number: "18446744073709428160" | |
149 | zero-padded LDN: "-000123456" | |
150 | left-adjusted ZLDN: "-123456 " | |
151 | space-padded LDN: " -123456" | |
152 | left-adjusted SLDN: "-123456 " | |
153 | zero-padded string: " Hi, Z." | |
154 | left-adjusted Z string: "Hi, Z. " | |
155 | space-padded string: " Hi, Z." | |
156 | left-adjusted S string: "Hi, Z. " | |
157 | null string: "(null)" | |
158 | limited string: "Good morning, Doctor C" | |
179dcdb7 TMQMF |
159 | a-style max: "0x1.fffffffffffffp+1023" |
160 | a-style -max: "-0x1.fffffffffffffp+1023" | |
2a82441b UD |
161 | e-style >= 1: "1.234000e+01" |
162 | e-style >= .1: "1.234000e-01" | |
163 | e-style < .1: "1.234000e-03" | |
164 | e-style big: "1.000000000000000000000000000000000000000000000000000000000000e+20" | |
165 | e-style == .1: "1.000000e-01" | |
166 | f-style >= 1: "12.340000" | |
167 | f-style >= .1: "0.123400" | |
168 | f-style < .1: "0.001234" | |
169 | g-style >= 1: "12.34" | |
170 | g-style >= .1: "0.1234" | |
171 | g-style < .1: "0.001234" | |
172 | g-style big: "100000000000000000000" | |
173 | 0.10000 | |
174 | 0.10000 | |
175 | x0.5000x | |
176 | 0x1 | |
177 | something really insane: 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | |
178 | 5.87747175411143754e-39 | |
179 | 5.87747175411143754e-39 | |
180 | 5.87747175411143754e-39 | |
181 | 5.87747175411143754e-39 | |
182 | 5.87747175411143754e-39 | |
183 | 5.87747175411143754e-39 | |
184 | 5.87747175411143754e-39 | |
185 | 5.87747175411143754e-39 | |
186 | 5.87747175411143754e-39 | |
187 | 5.87747175411143754e-39 | |
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 | 4.94066e-324 | |
196 | | 0.0000| 0.0000e+00| 0| | |
197 | | 1.0000| 1.0000e+00| 1| | |
198 | | -1.0000| -1.0000e+00| -1| | |
199 | | 100.0000| 1.0000e+02| 100| | |
200 | | 1000.0000| 1.0000e+03| 1000| | |
201 | | 10000.0000| 1.0000e+04| 1e+04| | |
202 | | 12345.0000| 1.2345e+04| 1.234e+04| | |
203 | | 100000.0000| 1.0000e+05| 1e+05| | |
204 | | 123456.0000| 1.2346e+05| 1.235e+05| | |
205 | snprintf ("%30s", "foo") == 30, " " | |
351f0765 | 206 | snprintf ("%.999999u", 10) == 999999 |
179dcdb7 TMQMF |
207 | 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00000000 |
208 | -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00000000 | |
2a82441b UD |
209 | 1.234568e+06 should be 1.234568e+06 |
210 | 1234567.800000 should be 1234567.800000 | |
211 | 1.23457e+06 should be 1.23457e+06 | |
212 | 123.456 should be 123.456 | |
213 | 1e+06 should be 1e+06 | |
214 | 10 should be 10 | |
215 | 0.02 should be 0.02 | |
2a82441b UD |
216 | Test ok. |
217 | sprintf (buf, "%07Lo", 040000000000ll) = 40000000000 | |
655de5fd UD |
218 | printf ("%hhu", 257) = 1 |
219 | printf ("%hu", 65537) = 1 | |
d2dc7b08 UD |
220 | printf ("%hhi", 257) = 1 |
221 | printf ("%hi", 65537) = 1 | |
222 | printf ("%1$hhu", 257) = 1 | |
223 | printf ("%1$hu", 65537) = 1 | |
224 | printf ("%1$hhi", 257) = 1 | |
225 | printf ("%1$hi", 65537) = 1 | |
2a82441b UD |
226 | --- Should be no further output. --- |
227 | EOF | |
1746f2b0 | 228 | cmp - ${common_objpfx}stdio-common/tst-printf.out > /dev/null 2>&1 || |
2a82441b UD |
229 | { |
230 | status=1 | |
231 | echo "*** output comparison failed" | |
232 | } | |
0755050e UD |
233 | |
234 | exit $status |