1 /* { dg-do run } */
2 /* { dg-options "-fwrapv" } */
3 
4 void foo( unsigned long long bb, unsigned short tn, unsigned e, unsigned* w );
foo(unsigned long long bb,unsigned short tn,unsigned e,unsigned * w)5 void foo( unsigned long long bb, unsigned short tn, unsigned e, unsigned* w )
6 {
7         unsigned n = tn + bb;
8         do {
9                 e = (e > n) ? e : *w;
10                 n -= (e > n) ? n : e;
11                 if (*w)
12                         *w = 0;
13         } while ( n );
14 }
main()15 int main()
16 {
17         unsigned w = 0;
18         foo( 0, 0, 0, &w );
19         return 0;
20 }
21