Unified · Split
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * TCC auto test program |
| 3 | 3 | */ |
| 4 | −#include <tcclib.h> | |
| 5 | 4 | |
| 6 | 5 | /* Unfortunately, gcc version < 3 does not handle that! */ |
| 7 | 6 | //#define ALL_ISOC99 |
| @@ -11,6 +10,25 @@ · 3 unmodified lines | ||
| 11 | 10 | |
| 12 | 11 | #define C99_MACROS |
| 13 | 12 | |
| 13 | +/* test various include syntaxes */ | |
| 14 | + | |
| 15 | +#define TCCLIB_INC <tcclib.h> | |
| 16 | +#define TCCLIB_INC1 <tcclib | |
| 17 | +#define TCCLIB_INC2 h> | |
| 18 | +#define TCCLIB_INC3 "tcclib" | |
| 19 | + | |
| 20 | +#include TCCLIB_INC | |
| 21 | + | |
| 22 | +#include TCCLIB_INC1.TCCLIB_INC2 | |
| 23 | + | |
| 24 | +#include TCCLIB_INC1.h> | |
| 25 | + | |
| 26 | +#include TCCLIB_INC3 ".h" | |
| 27 | + | |
| 28 | +#include <tcclib.h> | |
| 29 | + | |
| 30 | +#include "tcclib.h" | |
| 31 | + | |
| 14 | 32 | void string_test(); |
| 15 | 33 | void expr_test(); |
| 16 | 34 | void macro_test(); |
| @@ -158,6 +176,14 @@ void macro_test() · 141 unmodified lines | ||
| 158 | 176 | |
| 159 | 177 | printf("__LINE__=%d __FILE__=%s\n", |
| 160 | 178 | __LINE__, __FILE__); |
| 179 | +#line 200 | |
| 180 | + printf("__LINE__=%d __FILE__=%s\n", | |
| 181 | + __LINE__, __FILE__); | |
| 182 | +#line 203 "test" | |
| 183 | + printf("__LINE__=%d __FILE__=%s\n", | |
| 184 | + __LINE__, __FILE__); | |
| 185 | +#line 185 "tcctest.c" | |
| 186 | + | |
| 161 | 187 | /* not strictly preprocessor, but we test it there */ |
| 162 | 188 | #ifdef C99_MACROS |
| 163 | 189 | printf("__func__ = %s\n", __func__); |
| @@ -428,7 +454,9 @@ void array_test(int a[4]) · 264 unmodified lines | ||
| 428 | 454 | printf("sizeof(char) = %d\n", sizeof(char)); |
| 429 | 455 | printf("sizeof(unsigned char) = %d\n", sizeof(unsigned char)); |
| 430 | 456 | printf("sizeof(\"a\") = %d\n", sizeof("a")); |
| 457 | +#ifdef C99_MACROS | |
| 431 | 458 | printf("sizeof(__func__) = %d\n", sizeof(__func__)); |
| 459 | +#endif | |
| 432 | 460 | printf("sizeof tab %d\n", sizeof(tab)); |
| 433 | 461 | printf("sizeof tab2 %d\n", sizeof tab2); |
| 434 | 462 | tab[0] = 1; |