summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/bpf/xbpf-callee-saved-regs-1.c
blob: 6d6fe6e8e1bb425f41467901915859f55850e9b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* { dg-options "-mxbpf" } */

/* GCC should save and restore callee-saved registers when generating
   code for xBPF.  */

int
foo ()
{
  register int f asm ("r6");

  f = 20;
  return f + 1;
}

/* { dg-final { scan-assembler "stxdw\t\\\[%fp\\+-8\\\],%r6" } } */
/* { dg-final { scan-assembler "ldxdw\t%r6,\\\[%fp\\+-8\\\]" } } */