OSDN Git Service

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