quakeforge/tools/qfcc/test/static-init.r
Bill Currie 1fcb16d8cf [qfcc] Add failing test for static init
The function local static init is being treated as a non-static init
(ie, initialized each call).
2021-01-13 18:35:24 +09:00

19 lines
237 B
R

#include "test-harness.h"
int count_down ()
{
static int count = 2;
count--;
return count > 0;
}
int main()
{
int ret = 0;
count_down ();
if (count_down ()) {
printf ("did not reach 0\n");
ret |= 1;
}
return ret;
}