ubuntu-buildroot/output/build/host-gcc-initial-11.4.0/gcc/testsuite/gcc.target/powerpc/extswsli-1.c

20 lines
587 B
C
Raw Permalink Normal View History

2024-04-01 15:19:46 +00:00
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-require-effective-target powerpc_p9modulo_ok } */
/* { dg-options "-mdejagnu-cpu=power9 -O2" } */
static int mem;
int *ptr = &mem;
long
add (long *p, int reg)
{
__asm__ (" #foo %0" : "+r" (reg));
return p[reg] + p[mem];
}
/* { dg-final { scan-assembler-times "extswsli " 2 } } */
/* { dg-final { scan-assembler-times "lwz " 1 } } */
/* { dg-final { scan-assembler-not "lwa " } } */
/* { dg-final { scan-assembler-not "sldi " } } */
/* { dg-final { scan-assembler-not "extsw " } } */