1 /* { dg-do compile } */
2 /* { dg-do run } */
3 /* { dg-options "-Os" } */
4
5 unsigned int
foo(unsigned int x)6 foo (unsigned int x)
7 {
8 unsigned int r = x;
9 while (--x)
10 r *= x;
11 return r;
12 }
13
14 unsigned long long
bar(unsigned long long x)15 bar (unsigned long long x)
16 {
17 unsigned long long r = x;
18 while (--x)
19 r *= x;
20 return r;
21 }
22
23 extern void abort (void);
24
25 int
main(void)26 main (void)
27 {
28 if (foo (5) != 120 || bar (5) != 120)
29 abort ();
30 return 0;
31 }
32