summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-abs-2.c
blob: 6291d7e5384ce8be1c910361d4eafcbce23e482b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do run } */
/* { dg-options "-O1 -fwrapv" } */
#include <limits.h>
void exit (int);
void abort ();
#define ABS(x) (x > 0 ? x : -x)
int f (int a) {
	if (ABS(a) >= 0) return 1;
	else return 0;
}

int main (int argc, char *argv[]) {
	if (f(INT_MIN))
	  abort ();
	else
	  exit (0);
}