OSDN Git Service

Latest updates from FSF 4.7 branch
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / xstormy16 / sfr / 25_clr_sfrw_bitfield_7.c
1 /* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */
2
3 typedef struct
4 {
5   unsigned short b0:1;
6   unsigned short b1:1;
7   unsigned short b2:1;
8   unsigned short b3:1;
9   unsigned short b4:1;
10   unsigned short b5:1;
11   unsigned short b6:1;
12   unsigned short b7:1;
13   unsigned short b8:1;
14   unsigned short b9:1;
15   unsigned short b10:1;
16   unsigned short b11:1;
17   unsigned short b12:1;
18   unsigned short b13:1;
19   unsigned short b14:1;
20   unsigned short b15:1;
21 } BitField;
22
23 #define SFR (*((volatile BitField*)0x7f14))
24 unsigned short *p = (unsigned short *) 0x7f14;
25
26 void
27 Do (void)
28 {
29   SFR.b7 = 0;
30 }
31
32 int
33 main (void)
34 {
35   *p = 0xedcb;
36   Do ();
37   return (*p == 0xed4b) ? 0 : 1;
38 }
39
40 /* { dg-final { scan-file "25_clr_sfrw_bitfield_7.s" "clr1 32532,#7" } } */
41