mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-27 06:34:11 +00:00
29 lines
369 B
R
29 lines
369 B
R
int min;
|
|
int times;
|
|
|
|
void bar (int x)
|
|
{
|
|
if (x < min)
|
|
min = x;
|
|
}
|
|
|
|
void foo (int count)
|
|
{
|
|
int safety = count; // in case qfcc screws up (prevents infinite loop)
|
|
min = count;
|
|
while (count--) { //XXX this is the code being tested
|
|
bar (count);
|
|
times++;
|
|
safety--;
|
|
if (safety < 0)
|
|
break;
|
|
}
|
|
}
|
|
|
|
int
|
|
main ()
|
|
{
|
|
int c = 3;
|
|
foo (c);
|
|
return min || times != c;
|
|
}
|