OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [xstormy16/] [sfr/] [20_set_sfrb_bitfield_7.c] - Blame information for rev 751

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */
2
/* { dg-final { scan-assembler "set1 32532,#7" } } */
3
 
4
typedef struct
5
{
6
  unsigned char b0:1;
7
  unsigned char b1:1;
8
  unsigned char b2:1;
9
  unsigned char b3:1;
10
  unsigned char b4:1;
11
  unsigned char b5:1;
12
  unsigned char b6:1;
13
  unsigned char b7:1;
14
} BitField;
15
 
16
#define SFR (*((volatile BitField*)0x7f14))
17
unsigned char *p = (unsigned char *) 0x7f14;
18
 
19
void
20
Do (void)
21
{
22
  SFR.b7 = 1;
23
}
24
 
25
int
26
main (void)
27
{
28
  *p = 0x34;
29
  Do ();
30
  return (*p == 0xb4) ? 0 : 1;
31
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.