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

extern void overflow_handler ();

unsigned long overflow_sub (unsigned long x, unsigned long y)
{
  unsigned long r;

  int ovr = __builtin_usubl_overflow (x, y, &r);
  if (ovr)
    overflow_handler ();

  return r;
}

/* { dg-final { scan-assembler "subs" } } */