OSDN Git Service

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