2 20020508-1.c from the execute part of the gcc torture suite.
11 /* This tests the rotate patterns that some machines support. */
19 #define ROR(a,b) (((a) >> (b)) | ((a) << ((sizeof (a) * CHAR_BIT) - (b))))
20 #define ROL(a,b) (((a) << (b)) | ((a) >> ((sizeof (a) * CHAR_BIT) - (b))))
22 #define CHAR_VALUE ((unsigned char)0xf234U)
23 #define SHORT_VALUE ((unsigned short)0xf234U)
24 #define INT_VALUE 0xf234U
25 #define LONG_VALUE 0xf2345678LU
26 #define LL_VALUE 0xf2345678abcdef0LLU
29 #define SHIFT2 ((sizeof (long long) * CHAR_BIT) - SHIFT1)
31 unsigned char uc
= CHAR_VALUE
;
32 unsigned short us
= SHORT_VALUE
;
33 unsigned int ui
= INT_VALUE
;
34 unsigned long ul
= LONG_VALUE
;
35 unsigned long long ull
= LL_VALUE
;
40 testTortureExecute (void)
42 if (ROR (uc
, shift1
) != ROR (CHAR_VALUE
, SHIFT1
))
45 if (ROR (uc
, SHIFT1
) != ROR (CHAR_VALUE
, SHIFT1
))
48 if (ROR (us
, shift1
) != ROR (SHORT_VALUE
, SHIFT1
))
51 if (ROR (us
, SHIFT1
) != ROR (SHORT_VALUE
, SHIFT1
))
53 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
54 if (ROR (ui
, shift1
) != ROR (INT_VALUE
, SHIFT1
))
57 if (ROR (ui
, SHIFT1
) != ROR (INT_VALUE
, SHIFT1
))
60 if (ROR (ul
, shift1
) != ROR (LONG_VALUE
, SHIFT1
))
63 if (ROR (ul
, SHIFT1
) != ROR (LONG_VALUE
, SHIFT1
))
66 if (ROR (ull
, shift1
) != ROR (LL_VALUE
, SHIFT1
))
69 if (ROR (ull
, SHIFT1
) != ROR (LL_VALUE
, SHIFT1
))
72 if (ROR (ull
, shift2
) != ROR (LL_VALUE
, SHIFT2
))
75 if (ROR (ull
, SHIFT2
) != ROR (LL_VALUE
, SHIFT2
))
78 if (ROL (uc
, shift1
) != ROL (CHAR_VALUE
, SHIFT1
))
81 if (ROL (uc
, SHIFT1
) != ROL (CHAR_VALUE
, SHIFT1
))
84 if (ROL (us
, shift1
) != ROL (SHORT_VALUE
, SHIFT1
))
87 if (ROL (us
, SHIFT1
) != ROL (SHORT_VALUE
, SHIFT1
))
90 if (ROL (ui
, shift1
) != ROL (INT_VALUE
, SHIFT1
))
93 if (ROL (ui
, SHIFT1
) != ROL (INT_VALUE
, SHIFT1
))
96 if (ROL (ul
, shift1
) != ROL (LONG_VALUE
, SHIFT1
))
99 if (ROL (ul
, SHIFT1
) != ROL (LONG_VALUE
, SHIFT1
))
102 if (ROL (ull
, shift1
) != ROL (LL_VALUE
, SHIFT1
))
105 if (ROL (ull
, SHIFT1
) != ROL (LL_VALUE
, SHIFT1
))
108 if (ROL (ull
, shift2
) != ROL (LL_VALUE
, SHIFT2
))
111 if (ROL (ull
, SHIFT2
) != ROL (LL_VALUE
, SHIFT2
))