1 /* $NetBSD: fmtio_check.c,v 1.2 2002/02/21 07:38:17 itojun Exp $ */
4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
33 int main(int, char *[]);
35 #define PRINT(fmt, var) \
36 snprintf(buf, sizeof(buf), "%" fmt, var)
38 #define SCAN(fmt, var) \
39 sscanf(buf, "%" fmt, &var)
42 main(int argc
, char *argv
[])
79 PRINT(PRIdLEAST8
, il8
);
80 PRINT(PRIdLEAST16
, il16
);
81 PRINT(PRIdLEAST32
, il32
);
82 PRINT(PRIdLEAST64
, il64
);
83 PRINT(PRIdFAST8
, if8
);
84 PRINT(PRIdFAST16
, if16
);
85 PRINT(PRIdFAST32
, if32
);
86 PRINT(PRIdFAST64
, if64
);
94 PRINT(PRIiLEAST8
, il8
);
95 PRINT(PRIiLEAST16
, il16
);
96 PRINT(PRIiLEAST32
, il32
);
97 PRINT(PRIiLEAST64
, il64
);
98 PRINT(PRIiFAST8
, if8
);
99 PRINT(PRIiFAST16
, if16
);
100 PRINT(PRIiFAST32
, if32
);
101 PRINT(PRIiFAST64
, if64
);
109 PRINT(PRIoLEAST8
, uil8
);
110 PRINT(PRIoLEAST16
, uil16
);
111 PRINT(PRIoLEAST32
, uil32
);
112 PRINT(PRIoLEAST64
, uil64
);
113 PRINT(PRIoFAST8
, uif8
);
114 PRINT(PRIoFAST16
, uif16
);
115 PRINT(PRIoFAST32
, uif32
);
116 PRINT(PRIoFAST64
, uif64
);
124 PRINT(PRIuLEAST8
, uil8
);
125 PRINT(PRIuLEAST16
, uil16
);
126 PRINT(PRIuLEAST32
, uil32
);
127 PRINT(PRIuLEAST64
, uil64
);
128 PRINT(PRIuFAST8
, uif8
);
129 PRINT(PRIuFAST16
, uif16
);
130 PRINT(PRIuFAST32
, uif32
);
131 PRINT(PRIuFAST64
, uif64
);
139 PRINT(PRIxLEAST8
, uil8
);
140 PRINT(PRIxLEAST16
, uil16
);
141 PRINT(PRIxLEAST32
, uil32
);
142 PRINT(PRIxLEAST64
, uil64
);
143 PRINT(PRIxFAST8
, uif8
);
144 PRINT(PRIxFAST16
, uif16
);
145 PRINT(PRIxFAST32
, uif32
);
146 PRINT(PRIxFAST64
, uif64
);
154 PRINT(PRIXLEAST8
, uil8
);
155 PRINT(PRIXLEAST16
, uil16
);
156 PRINT(PRIXLEAST32
, uil32
);
157 PRINT(PRIXLEAST64
, uil64
);
158 PRINT(PRIXFAST8
, uif8
);
159 PRINT(PRIXFAST16
, uif16
);
160 PRINT(PRIXFAST32
, uif32
);
161 PRINT(PRIXFAST64
, uif64
);
170 SCAN(SCNdLEAST8
, il8
);
171 SCAN(SCNdLEAST16
, il16
);
172 SCAN(SCNdLEAST32
, il32
);
173 SCAN(SCNdLEAST64
, il64
);
174 SCAN(SCNdFAST8
, if8
);
175 SCAN(SCNdFAST16
, if16
);
176 SCAN(SCNdFAST32
, if32
);
177 SCAN(SCNdFAST64
, if64
);
185 SCAN(SCNiLEAST8
, il8
);
186 SCAN(SCNiLEAST16
, il16
);
187 SCAN(SCNiLEAST32
, il32
);
188 SCAN(SCNiLEAST64
, il64
);
189 SCAN(SCNiFAST8
, if8
);
190 SCAN(SCNiFAST16
, if16
);
191 SCAN(SCNiFAST32
, if32
);
192 SCAN(SCNiFAST64
, if64
);
200 SCAN(SCNoLEAST8
, uil8
);
201 SCAN(SCNoLEAST16
, uil16
);
202 SCAN(SCNoLEAST32
, uil32
);
203 SCAN(SCNoLEAST64
, uil64
);
204 SCAN(SCNoFAST8
, uif8
);
205 SCAN(SCNoFAST16
, uif16
);
206 SCAN(SCNoFAST32
, uif32
);
207 SCAN(SCNoFAST64
, uif64
);
215 SCAN(SCNuLEAST8
, uil8
);
216 SCAN(SCNuLEAST16
, uil16
);
217 SCAN(SCNuLEAST32
, uil32
);
218 SCAN(SCNuLEAST64
, uil64
);
219 SCAN(SCNuFAST8
, uif8
);
220 SCAN(SCNuFAST16
, uif16
);
221 SCAN(SCNuFAST32
, uif32
);
222 SCAN(SCNuFAST64
, uif64
);
230 SCAN(SCNxLEAST8
, uil8
);
231 SCAN(SCNxLEAST16
, uil16
);
232 SCAN(SCNxLEAST32
, uil32
);
233 SCAN(SCNxLEAST64
, uil64
);
234 SCAN(SCNxFAST8
, uif8
);
235 SCAN(SCNxFAST16
, uif16
);
236 SCAN(SCNxFAST32
, uif32
);
237 SCAN(SCNxFAST64
, uif64
);