2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr50751-2.c
blobc8780f94e4d39eb3d6ed88de0a238cdb99ee6aef
1 /* Check that the mov.b displacement addressing insn is generated and the
2 base address is adjusted only once. On SH2A this test is skipped because
3 there is a 4 byte mov.b insn that can handle larger displacements. Thus
4 on SH2A the base address will not be adjusted in this case. */
5 /* { dg-do compile { target { ! sh2a } } } */
6 /* { dg-options "-O1" } */
7 /* { dg-final { scan-assembler-times "add" 2 } } */
9 void
10 testfunc_00 (const char* ap, char* bp)
12 bp[0] = ap[15];
13 bp[2] = ap[5];
14 bp[9] = ap[7];
15 bp[0] = ap[25];
18 void
19 testfunc_01 (volatile const char* ap, volatile char* bp)
21 bp[0] = ap[15];
22 bp[2] = ap[5];
23 bp[9] = ap[7];
24 bp[0] = ap[25];