Ticket #9928: conftest.c

File conftest.c, 5.5 KB (added by bonefish, 11 years ago)

Crashing test

Line 
1/* confdefs.h */
2#define PACKAGE_NAME "GNU M4"
3#define PACKAGE_TARNAME "m4"
4#define PACKAGE_VERSION "1.4.16"
5#define PACKAGE_STRING "GNU M4 1.4.16"
6#define PACKAGE_BUGREPORT "bug-m4@gnu.org"
7#define PACKAGE_URL "http://www.gnu.org/software/m4/"
8#define PACKAGE "m4"
9#define VERSION "1.4.16"
10#define STDC_HEADERS 1
11#define HAVE_SYS_TYPES_H 1
12#define HAVE_SYS_STAT_H 1
13#define HAVE_STDLIB_H 1
14#define HAVE_STRING_H 1
15#define HAVE_MEMORY_H 1
16#define HAVE_STRINGS_H 1
17#define HAVE_INTTYPES_H 1
18#define HAVE_STDINT_H 1
19#define HAVE_UNISTD_H 1
20#define __EXTENSIONS__ 1
21#define _ALL_SOURCE 1
22#define _GNU_SOURCE 1
23#define _POSIX_PTHREAD_SEMANTICS 1
24#define _TANDEM_SOURCE 1
25#define HAVE_FSEEKO 1
26#define HAVE_UNSIGNED_LONG_LONG_INT 1
27#define HAVE_LONG_LONG_INT 1
28#define HAVE_UNSIGNED_LONG_LONG_INT 1
29#define HAVE_ALLOCA_H 1
30#define HAVE_ALLOCA 1
31#define HAVE_BTOWC 1
32#define HAVE_SETRLIMIT 1
33#define HAVE_SIGALTSTACK 1
34#define HAVE_GETCWD 1
35#define HAVE_READLINK 1
36#define HAVE_REALPATH 1
37#define HAVE_DUP2 1
38#define HAVE_FCNTL 1
39#define HAVE_FPURGE 1
40#define HAVE___FPURGE 1
41#define HAVE___FREADING 1
42#define HAVE_GETDTABLESIZE 1
43#define HAVE_GETTIMEOFDAY 1
44#define HAVE_LSTAT 1
45#define HAVE_MBSINIT 1
46#define HAVE_MBRTOWC 1
47#define HAVE_MPROTECT 1
48#define HAVE_MEMCHR 1
49#define HAVE_MKSTEMP 1
50#define HAVE_NL_LANGINFO 1
51#define HAVE_PATHCONF 1
52#define HAVE_ISBLANK 1
53#define HAVE_ISWCTYPE 1
54#define HAVE_WCSCOLL 1
55#define HAVE_SIGACTION 1
56#define HAVE_SIGINTERRUPT 1
57#define HAVE_STRNDUP 1
58#define HAVE_PIPE 1
59#define HAVE_WCRTOMB 1
60#define HAVE_ISWCNTRL 1
61#define HAVE_LINK 1
62#define HAVE_SETENV 1
63#define HAVE_STRDUP 1
64#define HAVE_SYMLINK 1
65#define HAVE_WCTOB 1
66#define HAVE_LANGINFO_CODESET 1
67#define HAVE_UNISTD_H 1
68#define HAVE_SYS_PARAM_H 1
69#define HAVE_STDIO_EXT_H 1
70#define HAVE_GETOPT_H 1
71#define HAVE_SYS_TIME_H 1
72#define HAVE_LANGINFO_H 1
73#define HAVE_MATH_H 1
74#define HAVE_SYS_MMAN_H 1
75#define HAVE_SCHED_H 1
76#define HAVE_WCHAR_H 1
77#define HAVE_STDINT_H 1
78#define HAVE_SYS_SOCKET_H 1
79#define HAVE_SYS_STAT_H 1
80#define HAVE_SYS_WAIT_H 1
81#define HAVE_WCTYPE_H 1
82#define FAULT_YIELDS_SIGBUS 0
83#define HAVE_STACK_OVERFLOW_HANDLING 1
84#define HAVE_XSI_STACK_OVERFLOW_HEURISTIC 1
85#define HAVE_DECL_STRERROR_R 1
86#define HAVE_STRERROR_R 1
87#define HAVE_SIG_ATOMIC_T 1
88#define HAVE_WORKING_O_NOATIME 0
89#define HAVE_WORKING_O_NOFOLLOW 1
90#define HAVE_DECL_FSEEKO 1
91#define HAVE_DECL_FTELLO 1
92#define HAVE_GETOPT_H 1
93#define HAVE_GETOPT_LONG_ONLY 1
94#define HAVE_DECL_GETENV 1
95#define __GETOPT_PREFIX rpl_
96#define restrict __restrict
97#define FLT_EXPBIT0_WORD 0
98#define FLT_EXPBIT0_BIT 23
99#define HAVE_DECL_GETC_UNLOCKED 1
100#define HAVE_STDLIB_H 1
101#define MALLOC_0_IS_NONNULL 1
102#define HAVE_MBSTATE_T 1
103#define HAVE_MAP_ANONYMOUS 1
104#define PROMOTED_MODE_T mode_t
105#define HAVE_DECL_SNPRINTF 1
106#define HAVE__BOOL 1
107#define HAVE_WCHAR_T 1
108#define HAVE_DECL_STRNDUP 1
109#define HAVE_DECL_STRNLEN 1
110#define HAVE_DECL_STRSIGNAL 1
111#define HAVE_DECL_SYS_SIGLIST 1
112#define HAVE_DECL_STRTOD 1
113#define HAVE_DECL_CLEARERR_UNLOCKED 1
114#define HAVE_DECL_FEOF_UNLOCKED 1
115#define HAVE_DECL_FERROR_UNLOCKED 1
116#define HAVE_DECL_FFLUSH_UNLOCKED 1
117#define HAVE_DECL_FGETS_UNLOCKED 0
118#define HAVE_DECL_FPUTC_UNLOCKED 1
119#define HAVE_DECL_FPUTS_UNLOCKED 0
120#define HAVE_DECL_FREAD_UNLOCKED 0
121#define HAVE_DECL_FWRITE_UNLOCKED 0
122#define HAVE_DECL_GETCHAR_UNLOCKED 1
123#define HAVE_DECL_PUTC_UNLOCKED 1
124#define HAVE_DECL_PUTCHAR_UNLOCKED 1
125#define HAVE_WINT_T 1
126#define HAVE_INTTYPES_H_WITH_UINTMAX 1
127#define HAVE_STDINT_H_WITH_UINTMAX 1
128#define HAVE_INTMAX_T 1
129#define HAVE_SNPRINTF 1
130#define HAVE_STRNLEN 1
131#define HAVE_WCSLEN 1
132#define HAVE_WCSNLEN 1
133#define HAVE_MBRTOWC 1
134#define HAVE_WCRTOMB 1
135#define HAVE_DECL__SNPRINTF 0
136#define HAVE_SNPRINTF_RETVAL_C99 1
137#define CHECK_PRINTF_SAFE 1
138/* end confdefs.h. */
139
140#include <stdio.h>
141#include <string.h>
142static char buf[100];
143int main ()
144{
145 int result = 0;
146 if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
147 || (strcmp (buf, "0x1.922p+1 33") != 0
148 && strcmp (buf, "0x3.244p+0 33") != 0
149 && strcmp (buf, "0x6.488p-1 33") != 0
150 && strcmp (buf, "0xc.91p-2 33") != 0))
151 result |= 1;
152 if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
153 || (strcmp (buf, "-0X1.922P+1 33") != 0
154 && strcmp (buf, "-0X3.244P+0 33") != 0
155 && strcmp (buf, "-0X6.488P-1 33") != 0
156 && strcmp (buf, "-0XC.91P-2 33") != 0))
157 result |= 2;
158 /* This catches a FreeBSD 6.1 bug: it doesn't round. */
159 if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
160 || (strcmp (buf, "0x1.83p+0 33") != 0
161 && strcmp (buf, "0x3.05p-1 33") != 0
162 && strcmp (buf, "0x6.0ap-2 33") != 0
163 && strcmp (buf, "0xc.14p-3 33") != 0))
164 result |= 4;
165 /* This catches a FreeBSD 6.1 bug. See
166 <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
167 if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0
168 || buf[0] == '0')
169 result |= 8;
170 /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug. */
171 if (sprintf (buf, "%.1a", 1.999) < 0
172 || (strcmp (buf, "0x1.0p+1") != 0
173 && strcmp (buf, "0x2.0p+0") != 0
174 && strcmp (buf, "0x4.0p-1") != 0
175 && strcmp (buf, "0x8.0p-2") != 0))
176 result |= 16;
177 /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
178 glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
179 if (sprintf (buf, "%.1La", 1.999L) < 0
180 || (strcmp (buf, "0x1.0p+1") != 0
181 && strcmp (buf, "0x2.0p+0") != 0
182 && strcmp (buf, "0x4.0p-1") != 0
183 && strcmp (buf, "0x8.0p-2") != 0))
184 result |= 32;
185 return result;
186}