aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/sh/pr39423-2.c
blob: 702384dc27a730bad3d344b29253df8c1b4fc732 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* Check that displacement addressing is used for indexed addresses with a
   small offset, instead of re-calculating the index and that the movu.w
   instruction is used on SH2A.  */
/* { dg-do compile }  */
/* { dg-options "-O2" } */
/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a*" } } */
/* { dg-final { scan-assembler-not "add\t#1" } } */
/* { dg-final { scan-assembler "movu.w" } } */

int
test_00 (unsigned short tab[], int index)
{
  return tab[index + 1];
}