From acba7d10a28ef8ff2b65b48687ec5b128794bc15 Mon Sep 17 00:00:00 2001 From: bellard Date: Sun, 18 Aug 2002 13:18:20 +0000 Subject: [PATCH] better #line and #include tests --- tcctest.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tcctest.c b/tcctest.c index 0f99aac8..27008035 100644 --- a/tcctest.c +++ b/tcctest.c @@ -1,7 +1,6 @@ /* * TCC auto test program */ -#include /* Unfortunately, gcc version < 3 does not handle that! */ //#define ALL_ISOC99 @@ -11,6 +10,25 @@ #define C99_MACROS +/* test various include syntaxes */ + +#define TCCLIB_INC +#define TCCLIB_INC1 +#define TCCLIB_INC3 "tcclib" + +#include TCCLIB_INC + +#include TCCLIB_INC1.TCCLIB_INC2 + +#include TCCLIB_INC1.h> + +#include TCCLIB_INC3 ".h" + +#include + +#include "tcclib.h" + void string_test(); void expr_test(); void macro_test(); @@ -158,6 +176,14 @@ void macro_test() printf("__LINE__=%d __FILE__=%s\n", __LINE__, __FILE__); +#line 200 + printf("__LINE__=%d __FILE__=%s\n", + __LINE__, __FILE__); +#line 203 "test" + printf("__LINE__=%d __FILE__=%s\n", + __LINE__, __FILE__); +#line 185 "tcctest.c" + /* not strictly preprocessor, but we test it there */ #ifdef C99_MACROS printf("__func__ = %s\n", __func__); @@ -428,7 +454,9 @@ void array_test(int a[4]) printf("sizeof(char) = %d\n", sizeof(char)); printf("sizeof(unsigned char) = %d\n", sizeof(unsigned char)); printf("sizeof(\"a\") = %d\n", sizeof("a")); +#ifdef C99_MACROS printf("sizeof(__func__) = %d\n", sizeof(__func__)); +#endif printf("sizeof tab %d\n", sizeof(tab)); printf("sizeof tab2 %d\n", sizeof tab2); tab[0] = 1; -- 2.11.4.GIT