aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/pr110320-3.c
blob: ffa8c6316b5dd5415dc994340b0a793a5688ea2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* PR target/110320 */
/* { dg-require-effective-target powerpc_pcrel } */
/* { dg-options "-O2 -mdejagnu-cpu=power10 -ffixed-r0 -ffixed-r2 -ffixed-r11 -ffixed-r12" } */

/* Ensure we don't use r2 as a normal volatile register for the code below.
   The test case ensures all of the parameter registers r3 - r10 are used
   and needed after we compute the expression "x + y" which requires a
   temporary.  The -ffixed-r* options disallow using the other volatile
   registers r0, r2, r11 and r12.  That only leaves RA to choose from the more
   expensive non-volatile registers for the temporary to be assigned to.  */

extern long bar (long, long, long, long, long, long, long, long *);

long
foo (long r3, long r4, long r5, long r6, long r7, long r8, long r9, long *r10)
{
  *r10 = r3 + r4;
  return bar (r3, r4, r5, r6, r7, r8, r9, r10);
}

/* { dg-final { scan-assembler-not {\madd 2,3,4\M} } } */