OSDN Git Service

Latest updates from FSF 4.7 branch
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / xstormy16 / bss_below100 / 26_if1_b100w_bitfield_8.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 B100A __attribute__ ((__BELOW100__));
25 unsigned short *pA = (unsigned short *) &B100A;
26 BitField B100B __attribute__ ((__BELOW100__));
27 unsigned short *pB = (unsigned short *) &B100B;
28
29 char *
30 Do (void)
31 {
32   if (B100A.b8)
33     {
34       if (B100B.b8)
35         return "Fail";
36       else
37         return "Success";
38     }
39   else
40     return "Fail";
41 }
42
43 int
44 main (void)
45 {
46   *pA = 0xedcb;
47   *pB = 0x1234;
48   return Do ()[0] == 'F';
49 }
50
51 /* { dg-final { scan-file "26_if1_b100w_bitfield_8.s" "b\[np\] B100A\\+1,#0," } } */
52 /* { dg-final { scan-file "26_if1_b100w_bitfield_8.s" "b\[np\] B100B\\+1,#0," } } */