summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug-2642.c
blob: 0b7e46ab926d9f83968584bc5f6a1c0348660337 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
   bug-2342.c
 */

#include <testfwk.h>

#define VIO (*((volatile unsigned char *) 0x400))

void testBug(void)
{
#if defined(__SDCC_stm8) // only enabled for stm8, since 0x400 maybe a dangerous place on other ports
	VIO = 0xff;
	VIO &= 0x7f;
	VIO &= 0xf7;
	ASSERT (VIO == 0x77);
	VIO |= 0x80;
	VIO |= 0x08;
	ASSERT (VIO == 0xff);
	VIO ^= 0x80;
	VIO ^= 0x08;
	ASSERT (VIO == 0x77);
#endif
}