aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59216.c
blob: 0de51bac95bc1f433844d63399578b98cc7298d5 (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
31
32
/* { dg-do run } */

#include <limits.h>

extern void abort (void);
extern void exit (int);

long long __attribute__((noinline)) f(int a)
{
  return -(long long) a;
}

int
main()
{
  if (f(0) != 0)
    abort ();

  if (f(1) != -(long long)1)
    abort ();

  if (f(-1) != -(long long)-1)
    abort ();

  if (f(INT_MIN) != -(long long)INT_MIN)
    abort ();

  if (f(INT_MAX) != -(long long)INT_MAX)
    abort ();

  exit (0);
}