struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / ato.c
blobb8230e3065fcf9bc01a75f89256df4402324ade9
1 /** ato.c
2 */
3 #include <testfwk.h>
4 #include <stdlib.h>
6 void
7 testAto(void)
9 ASSERT (atoi ("23") == 23);
10 ASSERT (atoi ("023") == 23);
11 ASSERT (atoi ("+23") == +23);
12 ASSERT (atoi ("-23") == -23);
13 ASSERT (atoi ("-32768") == -32768);
14 ASSERT (atoi ("+32767") == +32767);
16 #ifndef __SDCC_pdk14 // Not enough RAM
17 #if !(defined (__SDCC_pdk15) && defined(__SDCC_STACK_AUTO)) // Lack of code memory
18 ASSERT (atol ("-2147483648") == -2147483648l);
19 ASSERT (atol ("2147483647") == 2147483647l);
21 #ifndef __SDCC_pdk15 // Not enough RAM
22 #ifdef __SDCC_LONGLONG
23 ASSERT (atoll ("-2147483648") == -2147483648l);
24 ASSERT (atoll ("2147483647") == 2147483647l);
25 #endif
26 #endif
27 #endif
28 #endif