aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/sh/pr50751-7.c
blob: 014575ad0d485c23e80f8ef5edcea93696eef564 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* Check that mov.b and mov.w displacement insns are generated.
   If this is working properly, there should be no base address adjustments
   outside the mov insns.  */
/* { dg-do compile }  */
/* { dg-options "-O1" } */
/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */
/* { dg-final { scan-assembler-not "add|sub" } } */

typedef struct 
{
  char	a;
  char	b;
  char	c;
  char	d;

  short e;
  short f;

  int g;
  int h;
} X;

void
testfunc_00 (X* x)
{
  x->g = x->b | x->c;
  x->h = x->e | x->f;
  x->d = x->g;
  x->f = x->h;
}

int testfunc_01 (X* x)
{
  return x->b | x->e | x->g;
}