aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/cprophard.c
blob: 0aac9a509d4040a6fea9d7f14c9f4f9a7f285e7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* { dg-do compile { target lp64 } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-options "-O2 -mno-pcrel" } */
/* { dg-final { scan-assembler {ld 2,(24|40)\(1\)} } } */

/* From a linux kernel mis-compile of net/core/skbuff.c.  */
register unsigned long current_r1 asm ("r1");

void f (unsigned int n, void (*fun) (unsigned long))
{
  while (n--)
    (*fun) (current_r1 & -0x1000);
}