summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug-3083.c
blob: aac93139fca7e0f8bfd41b2e563d12ec57c8e171 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* bug-3083.c
   Invalid asm generated for bitwise or of variable allocated to a with sfr.
 */

#include <testfwk.h>

#include <stdint.h>

#if defined (__SDCC_pdk14) || defined (__SDCC_pdk15)
__sfr __at(0x0c) _integs;
#else
unsigned char _integs;
#endif

#define INTEGS _integs

struct {
  uint8_t val;
} my_struct;

volatile uint8_t val = 123;

void f(void)
{
  INTEGS |= val; // works
  INTEGS |= my_struct.val; // error
}

void
testBug(void)
{
}