OSDN Git Service

Latest updates from FSF 4.7 branch
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / xstormy16 / sfr / 12_if1_sfrb_bit_3.c
1 /* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */
2
3 #define SFRA (*((volatile unsigned char*)0x7f14))
4 unsigned char *pA = (unsigned char *) 0x7f14;
5 #define SFRB (*((volatile unsigned char*)0x7f10))
6 unsigned char *pB = (unsigned char *) 0x7f10;
7
8 char *
9 Do (void)
10 {
11   if (SFRA & 0x08)
12     {
13       if (SFRB & 0x08)
14         return "Fail";
15       else
16         return "Success";
17     }
18   else
19     return "Fail";
20 }
21
22 int
23 main (void)
24 {
25   *pA = 0xcb;
26   *pB = 0x34;
27   return Do ()[0] == 'F';
28 }
29
30 /* { dg-final { scan-file "12_if1_sfrb_bit_3.s" "b\[np\] " } } */
31