support c99 for-loop init decls

This commit is contained in:
Joe Soroka
2011-03-07 11:28:31 -08:00
parent 4fbe3cda33
commit e23194a1fa
4 changed files with 25 additions and 4 deletions

View File

@ -42,7 +42,7 @@ libtcc_test$(EXESUF): libtcc_test.c ../$(LIBTCC)
# copy only tcclib.h so GCC's stddef and stdarg will be used
test.ref: tcctest.c
cp -u ../include/tcclib.h .
$(CC) -o tcctest.gcc $< -I. -w $(CFLAGS)
$(CC) -o tcctest.gcc $< -I. -w $(CFLAGS) -std=gnu99
./tcctest.gcc > $@
# auto test

View File

@ -387,6 +387,10 @@ void loop_test()
} while (i < 10);
printf("\n");
/* c99 for loop init test */
for (size_t count = 1; count < 3; count++)
printf("count=%d\n", count);
/* break/continue tests */
i = 0;
while (1) {