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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [xstormy16/] [sfr/] [23_if0_sfrb_bitfield_3.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 "b\[np\] " } } */
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 SFRA (*((volatile BitField*)0x7f14))
17
unsigned char *pA = (unsigned char *) 0x7f14;
18
#define SFRB (*((volatile BitField*)0x7f10))
19
unsigned char *pB = (unsigned char *) 0x7f10;
20
 
21
char *
22
Do (void)
23
{
24
  if (!SFRA.b3)
25
    {
26
      if (!SFRB.b3)
27
        return "Fail";
28
      else
29
        return "Success";
30
    }
31
  else
32
    return "Fail";
33
}
34
 
35
int
36
main (void)
37
{
38
  *pA = 0x34;
39
  *pB = 0xcb;
40
  return Do ()[0] == 'F';
41
}

powered by: WebSVN 2.1.0

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