1 /*
2    loop-3b.c from the execute part of the gcc torture tests.
3  */
4 
5 #include <testfwk.h>
6 
7 #ifdef __SDCC
8 #pragma std_c99
9 #pragma disable_warning 85
10 #endif
11 
12 #include <limits.h>
13 
14 int n = 0;
15 
g(int i)16 void g (int i)
17 {
18   n++;
19 }
20 
f(int m)21 void f (int m)
22 {
23   int i;
24   i = m;
25   do
26     {
27       g (i * 4);
28       i -= INT_MAX / 8;
29     }
30   while (i > 0);
31 }
32 
33 void
testTortureExecute(void)34 testTortureExecute (void)
35 {
36   f (INT_MAX/8*4);
37   if (n != 4)
38     ASSERT (0);
39   return;
40 }
41