1
/* $Id: atol-1.c,v 1.1 2007/02/05 21:35:59 dmix Exp $ */
29
{ "-987654321", -987654321 },
30
{ "+1234567890", 1234567890 },
31
{ "2147483647", 2147483647 },
32
{ "-2147483647", -2147483647 },
33
{ "-2147483648", 0x80000000 },
35
/* Nonzero end character */
38
{ "1234/", 1234 }, /* '0'-1 == '/' */
39
{ "12345:", 12345 }, /* '9'+1 == ':' */
42
/* Empty symbols at begin */
45
{ "\t\n\v\f\r-321", -321 }, /* bug #18899 */
50
{ "\010123", 0 }, /* '\t'-1 == 010 */
51
{ "\016+123", 0 }, /* '\r'+1 == 016 */
53
/* atol() accepts 10-base only */
59
volatile long vlt = 1; /* for debug conveniency */
66
printf ("result=%ld against t[%d]={\"%s\", %ld}\n",
67
vlt, idx, t[idx].s, t[idx].val);
75
char s[sizeof(t[0].s)];
77
for (i = 0; i < (int)(sizeof(t) / sizeof(t[0])); i++) {
80
if (vlt != (long)pgm_read_dword (& t[i].val))