gcc/testsuite/gcc.dg/fold-abs-2.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-O1 -fwrapv" } */ |
| 3 | #include <limits.h> |
| 4 | void exit (int); |
| 5 | void abort (); |
| 6 | #define ABS(x) (x > 0 ? x : -x) |
| 7 | int f (int a) { |
| 8 | if (ABS(a) >= 0) return 1; |
| 9 | else return 0; |
| 10 | } |
| 11 | |
| 12 | int main (int argc, char *argv[]) { |
| 13 | if (f(INT_MIN)) |
| 14 | abort (); |
| 15 | else |
| 16 | exit (0); |
| 17 | } |