From e23194a1fa2ca176c9151964a2e035f36736e650 Mon Sep 17 00:00:00 2001 From: Joe Soroka Date: Mon, 7 Mar 2011 11:28:31 -0800 Subject: support c99 for-loop init decls --- tests/Makefile | 2 +- tests/tcctest.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/Makefile b/tests/Makefile index 4bebc2b..d1c732a 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -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 diff --git a/tests/tcctest.c b/tests/tcctest.c index 1b2fb36..e0e0dba 100644 --- a/tests/tcctest.c +++ b/tests/tcctest.c @@ -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) { -- cgit v1.3.1