summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-arith-1.c
blob: 659e2934b4d42e540dd8c79b2531a5de36169c0e (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
/*
   arith-1.c from the execute part of the gcc torture tests.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c89
#endif

unsigned
sat_add (unsigned i)
{
  unsigned ret = i + 1;
  if (ret < i)
    ret = i;
  return ret;
}

void
testTortureExecute (void)
{
  if (sat_add (~0U) != ~0U)
    ASSERT (0);
  return;
}