[gcc]
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr39423-2.c
blob962d982059ad7e96ba0e5d2b2b9d9d733ecb8efc
1 /* Check that displacement addressing is used for indexed addresses with a
2 small offset, instead of re-calculating the index and that the movu.w
3 instruction is used on SH2A. */
4 /* { dg-do compile { target { sh2a } } } */
5 /* { dg-options "-O2" } */
6 /* { dg-final { scan-assembler-not "add\t#1" } } */
7 /* { dg-final { scan-assembler "movu.w" } } */
9 int
10 test_00 (unsigned short tab[], int index)
12 return tab[index + 1];