gcc/testsuite/gcc.target/sparc/overflow-6.c
raw| 1 | /* PR target/97939 */ |
| 2 | /* Reported by Vincent Lefevre <[email protected]> */ |
| 3 | |
| 4 | /* { dg-do run } */ |
| 5 | |
| 6 | #include <limits.h> |
| 7 | |
| 8 | long add (long i) |
| 9 | { |
| 10 | long r; |
| 11 | if (!__builtin_add_overflow (i, 4096, &r)) |
| 12 | __builtin_abort (); |
| 13 | return r; |
| 14 | } |
| 15 | |
| 16 | int main (void) |
| 17 | { |
| 18 | add (LONG_MAX); |
| 19 | return 0; |
| 20 | } |