2018-03-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / extswsli-1.c
blob2d7aac331231c6fe017404e11f9a3ef77122efe1
1 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2 /* { dg-require-effective-target powerpc_p9modulo_ok } */
3 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
4 /* { dg-options "-mcpu=power9 -O2" } */
6 static int mem;
7 int *ptr = &mem;
9 long
10 add (long *p, int reg)
12 __asm__ (" #foo %0" : "+r" (reg));
13 return p[reg] + p[mem];
16 /* { dg-final { scan-assembler-times "extswsli " 2 } } */
17 /* { dg-final { scan-assembler-times "lwz " 1 } } */
18 /* { dg-final { scan-assembler-not "lwa " } } */
19 /* { dg-final { scan-assembler-not "sldi " } } */
20 /* { dg-final { scan-assembler-not "extsw " } } */