OSDN Git Service

* gcc.target/xstormy16: New test directory.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / xstormy16 / below_100.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
3 /* { dg-final { scan-assembler "bn " } } */
4 /* { dg-final { scan-assembler "bp " } } */
5
6 unsigned short   a_below __attribute__((__BELOW100__));
7 unsigned short   b_below __attribute__((__BELOW100__));
8 unsigned short * a_ptr = & a_below;
9 unsigned short * b_ptr = & b_below;
10
11 char *
12 foo (void)
13 {
14   if (a_below & 0x0100)
15     {
16       if (b_below & 0x0100)
17         return "Fail";
18       return "Success";
19     }
20
21   return "Fail";
22 }
23
24 char *
25 bar (void)
26 {
27   *a_ptr = 0x0100;
28   *b_ptr = 0xfeff;
29   return foo ();
30 }