Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.target / sh / pr50751-7.c
1 /* Check that mov.b and mov.w displacement insns are generated.
2    If this is working properly, there should be no base address adjustments
3    outside the mov insns.  */
4 /* { dg-do compile { target "sh*-*-*" } } */
5 /* { dg-options "-O1" } */
6 /* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */
7 /* { dg-final { scan-assembler-not "add|sub" } } */
8
9 typedef struct 
10 {
11   char  a;
12   char  b;
13   char  c;
14   char  d;
15
16   short e;
17   short f;
18
19   int g;
20   int h;
21 } X;
22
23 void
24 testfunc_00 (X* x)
25 {
26   x->g = x->b | x->c;
27   x->h = x->e | x->f;
28   x->d = x->g;
29   x->f = x->h;
30 }
31
32 int testfunc_01 (X* x)
33 {
34   return x->b | x->e | x->g;
35 }