summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/indexed-addr.c
blob: 6933b23e01a207dd41af7a51cc748aa6ede4b9d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-options "-O2" } */

/* { dg-final { scan-assembler "3,\.*3,\.*4" } }

/* Ensure that indexed address are output with base address in rA position
   and index in rB position.  */

char
do_one (char *base, unsigned long offset)
{
  return base[offset];
}