Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / support / valdiag / tests / overflow.c
blob39ecbd32dd3739873d71cab5b9207309d7077838
1 volatile char c;
2 volatile unsigned char uc;
3 volatile int i;
4 volatile unsigned u;
5 volatile long l;
6 volatile unsigned long ul;
8 #ifdef TEST0
9 void foo(void)
11 i = 10000 * 10000; /* WARNING(SDCC) */
12 i = 0x4000 * 0x4000; /* WARNING(SDCC) */
14 #endif
16 #ifdef TEST1
17 void foo(void)
19 uc = 1 << 7; /* IGNORE(SDCC) */ // Gives a false warning (bug #2733)
21 i = c << 10;
22 i = 1 << 10;
23 i = c << 16; /* WARNING(SDCC) */
24 i = 1 << 16; /* WARNING(SDCC) */
25 i = uc << 16; /* WARNING(SDCC) */
27 l = l << 31;
28 l = l << 32; /* WARNING(SDCC) */ /* IGNORE(GCC) */
29 l = ul << 32; /* WARNING(SDCC) */ /* IGNORE(GCC) */
31 #endif
34 #ifdef TEST2
35 void foo(void)
37 i = 1 >> 40; /* IGNORE(SDCC) */ /* WARNING(GCC) */ // Warning missing (bug #2734)
39 i = uc >> 7;
40 i = 1 >> 7;
41 i = uc >> 8; /* WARNING(SDCC) */
42 #if 0
43 i = 1 >> 8; /* WARN___(SDCC) */
44 #endif
46 #if 0
47 i = i >> 40; /* WARN___(GCC) */
48 #endif
50 i = u >> 15;
51 i = u >> 16; /* WARNING(SDCC) */
53 #if 0
54 i = l >> 40; /* WARN___(GCC) */
55 #endif
57 i = ul >> 31;
58 i = ul >> 32; /* WARNING(SDCC) */ /* IGNORE(GCC) */
60 #endif