1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
unsigned sat_add (unsigned i) { unsigned ret = i + 1; if (ret < i) ret = i; return ret; } main () { if (sat_add (~0U) != ~0U) abort (); exit (0); }