summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-20011126-1.c
blob: 3e3a1ba71d440201b6ccf8d026e19e134f5dfcef (plain) (blame)
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
/*
   20011126-1.c from the execute part of the gcc torture tests.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

/* Produced a overflow in ifcvt.c, causing S to contain 0xffffffff7fffffff.  */

int a = 1;

void
testTortureExecute (void)
{
// Some ports do not support long long yet.
#if !defined(__SDCC_pic14) && !defined(__SDCC_pic16)
  long long s;

  s = a;
  if (s < 0)
    s = -2147483648LL;
  else
    s = 2147483647LL;

  if (s < 0)
    ASSERT (0);

  return;
#endif
}