quakeforge/tools/qfcc/test/postop.r
Bill Currie 54839db826 [qfcc] Add some tests for postop--
Interestingly, intval-- works properly, but unsignedval-- does not (test
case fails). This is why menus blow up when opening the load/save
sub-menu.
2023-12-20 21:50:51 +09:00

30 lines
408 B
R

int array[3] = { -1, -1, -1 };
int array_index (void)
{
int i = 0;
for (int c = 0; c < 3; c++) {
array[i++] = 0;
}
return i == 3 && !(array[0] | array[1] | array[2]);
}
int iter_check (int count)
{
int i = count;
int iters = 0;
while (i-- > 0) {
iters++;
}
return iters == count;
}
int
main ()
{
int ret = 0;
ret |= !array_index ();
ret |= !iter_check (1);
return ret;
}