summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/adds.c
blob: aa423210dec504fa0a2d77237b74b02951bf6dc2 (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
/* { dg-do compile } */
/* { dg-options "-O2" } */

int z;
int
foo (int x, int y)
{
  int l = x + y;
  if (l == 0)
    return 5;

  /* { dg-final { scan-assembler "adds\tw\[0-9\]" } } */
  z = l ;
  return 25;
}

typedef long long s64;

s64 zz;
s64
foo2 (s64 x, s64 y)
{
  s64 l = x + y;
  if (l < 0)
    return 5;

  /* { dg-final { scan-assembler "adds\tx\[0-9\]" } } */
  zz = l ;
  return 25;
}