diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/fold-abs-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/fold-abs-2.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/fold-abs-2.c b/gcc/testsuite/gcc.dg/fold-abs-2.c new file mode 100644 index 0000000000..6291d7e538 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fold-abs-2.c @@ -0,0 +1,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); +} |