Debian Codegraph @

gcc/testsuite/gcc.target/sh/pr50751-1.c

raw
1 /* Check that the mov.b displacement addressing insn is generated.
2 If the insn is generated as expected, there should be no address
3 calculations outside the mov insns. */
4 /* { dg-do compile } */
5 /* { dg-options "-O1" } */
6 /* { dg-final { scan-assembler-not "add|sub" } } */
7
8 void
9 testfunc_00 (const char* ap, char* bp, char val)
10 {
11 bp[0] = ap[15];
12 bp[2] = ap[5];
13 bp[9] = ap[7];
14 bp[0] = ap[15];
15 bp[4] = val;
16 bp[14] = val;
17 }
18
19 void
20 testfunc_01 (volatile const char* ap, volatile char* bp, char val)
21 {
22 bp[0] = ap[15];
23 bp[2] = ap[5];
24 bp[9] = ap[7];
25 bp[0] = ap[15];
26 bp[4] = val;
27 bp[14] = val;
28 }
29