2 pr61306-1.c from the execute part of the gcc torture tests.
14 #define fake_const_swab32(x) ((uint32_t)( \
15 (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
16 (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
17 (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \
18 (( (int32_t)(x) & (int32_t)0xff000000UL) >> 24)))
20 /* Previous version of bswap optimization failed to consider sign extension
21 and as a result would replace an expression *not* doing a bswap by a
24 #ifndef __SDCC_pdk14 // Lack of memory
26 fake_bswap32 (uint32_t in
)
28 return fake_const_swab32 (in
);
33 testTortureExecute (void)
35 #ifndef __SDCC_pdk14 // Lack of memory
36 if (sizeof (int32_t) * CHAR_BIT
!= 32)
38 if (sizeof (uint32_t) * CHAR_BIT
!= 32)
40 if (fake_bswap32 (0x87654321) != 0xffffff87)