summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/neg_abs_1.c
blob: cb2a387088cc5874cd5e95f0c3ea6750537db9c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* { dg-options "-save-temps -O2" } */

int
f1 (int x)
{
  return x < 0 ? x : -x;
}

long long
f2 (long long x)
{
  return x < 0 ? x : -x;
}

/* { dg-final { scan-assembler-not "\tneg\tw\[0-9\]*.*" } } */
/* { dg-final { scan-assembler-not "\tneg\tx\[0-9\]*.*" } } */