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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [xstormy16/] [sfr/] [27_if0_sfrw_bitfield_3.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 329 jeremybenn
/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */
2
/* { dg-final { scan-assembler "bp 32532,#3" } } */
3
 
4
typedef struct
5
{
6
  unsigned short b0:1;
7
  unsigned short b1:1;
8
  unsigned short b2:1;
9
  unsigned short b3:1;
10
  unsigned short b4:1;
11
  unsigned short b5:1;
12
  unsigned short b6:1;
13
  unsigned short b7:1;
14
  unsigned short b8:1;
15
  unsigned short b9:1;
16
  unsigned short b10:1;
17
  unsigned short b11:1;
18
  unsigned short b12:1;
19
  unsigned short b13:1;
20
  unsigned short b14:1;
21
  unsigned short b15:1;
22
} BitField;
23
 
24
#define SFRA (*((volatile BitField*)0x7f14))
25
unsigned short *pA = (unsigned short *) 0x7f14;
26
#define SFRB (*((volatile BitField*)0x7f10))
27
unsigned short *pB = (unsigned short *) 0x7f10;
28
 
29
char *
30
Do (void)
31
{
32
  if (!SFRA.b3)
33
    {
34
      if (!SFRB.b3)
35
        return "Fail";
36
      else
37
        return "Success";
38
    }
39
  else
40
    return "Fail";
41
}
42
 
43
int
44
main (void)
45
{
46
  *pA = 0x1234;
47
  *pB = 0xedcb;
48
  return Do ()[0] == 'F';
49
}

powered by: WebSVN 2.1.0

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