1 /** extended tests for shift operations, added by
2 Frieder Ferlemann to check for bugs related to bug 1533966
12 # include <inttypes.h>
18 #define RIGHT ({right})
23 # define TYPE {sign}int8_t
24 # define TEST_VECT 0xa4
28 # define TYPE {sign}int16_t
29 # define TEST_VECT 0xa8ce
33 # define TYPE {sign}int32_t
34 # define TEST_VECT 0xa8b5c4d6
38 # define TYPE {sign}int64_t
39 # define TEST_VECT 0x8091a2b3c4d5e6f7
43 # define SHIFT(x,y) (TYPE)((TYPE)(x)<<(y))
45 # define SHIFT(x,y) (TYPE)((TYPE)(x)>>(y))
51 #pragma opt_code_speed
55 volatile TYPE s
= TEST_VECT
;
57 #define TESTSHIFT(x) t=s; t = SHIFT (t,(x)); ASSERT( t == SHIFT (TEST_VECT, (x)));
59 volatile TYPE t
= TEST_VECT
;
60 #define TESTSHIFT(x) t=TEST_VECT; t = SHIFT (t,(x)); ASSERT( t == SHIFT (TEST_VECT, (x)));
66 #ifndef __SDCC_pdk14 // Lack of memory
67 #if !(defined (__SDCC_pdk15) && defined(__SDCC_STACK_AUTO)) // Lack of code memory
88 #if !defined (__SDCC_pdk15) // Lack of code memory
109 #if !(defined (__SDCC_mcs51) && (defined(__SDCC_MODEL_SMALL) || defined(__SDCC_MODEL_MEDIUM))) // Lack of code memory