OSDN Git Service

Latest updates from FSF 4.7 branch
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / xstormy16 / bss_below100 / 24_set_b100w_bitfield_f.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 char acDummy[0xf0] __attribute__ ((__BELOW100__));
24 BitField B100 __attribute__ ((__BELOW100__));
25 unsigned short *p = (unsigned short *) &B100;
26
27 void
28 Do (void)
29 {
30   B100.b15 = 1;
31 }
32
33 int
34 main (void)
35 {
36   *p = 0x1234;
37   Do ();
38   return (*p == 0x9234) ? 0 : 1;
39 }
40
41 /* { dg-final { scan-file "24_set_b100w_bitfield_f.s" "set1 B100\\+1,#7" } } */
42