blob: 6441fed8687290e5d84e6b5b691786cd8eb9121c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/*
bug-3002.c - a bug in stm8 code generation for right shifts.
*/
#include <testfwk.h>
#include <stdint.h>
uint_least32_t f(uint_least32_t arg)
{
return((arg >> 22) | 0x15000000); // Operands chosen to encourage allocation of upper byte of shift result in accumulator and use of div for shift.
}
void testBug(void)
{
ASSERT(f(0xaaa00000) == 0x150002aa);
}
|