aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/extswsli-2.c
blob: 6542e621b84110cc43a5b5bfd1cac5f96b044aeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-require-effective-target powerpc_p9modulo_ok } */
/* { dg-options "-mdejagnu-cpu=power9 -O2" } */

long
func1 (int reg, int *is_zero)
{
  long value;

  __asm__ (" #foo %0" : "+r" (reg));
  value = ((long)reg) << 4;

  if (!value)
    *is_zero = 1;

  return value;
}

long
func2 (int *ptr, int *is_zero)
{
  int reg = *ptr;
  long value = ((long)reg) << 4;

  if (!value)
    *is_zero = 1;

  return value;
}

/* { dg-final { scan-assembler     "extswsli\\. " } } */
/* { dg-final { scan-assembler     "lwz "         } } */
/* { dg-final { scan-assembler-not "lwa "         } } */
/* { dg-final { scan-assembler-not "sldi "        } } */
/* { dg-final { scan-assembler-not "sldi\\. "     } } */
/* { dg-final { scan-assembler-not "extsw "       } } */