History

better #line and #include tests

bellard committed 24 years ago

Commit acba7d11 parent 3a58c531 file · +29 −1Browse files

Unified · Split

tcctest.c+29−1
@@ -1,7 +1,6 @@
1/*1/*
2 * TCC auto test program2 * TCC auto test program
3 */3 */
4#include <tcclib.h>
5 4
6/* Unfortunately, gcc version < 3 does not handle that! */5/* Unfortunately, gcc version < 3 does not handle that! */
7//#define ALL_ISOC996//#define ALL_ISOC99
@@ -11,6 +10,25 @@ · 3 unmodified lines
11 10
12#define C99_MACROS11#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
14void string_test();32void string_test();
15void expr_test();33void expr_test();
16void macro_test();34void macro_test();
@@ -158,6 +176,14 @@ void macro_test() · 141 unmodified lines
158 176
159 printf("__LINE__=%d __FILE__=%s\n",177 printf("__LINE__=%d __FILE__=%s\n",
160 __LINE__, __FILE__);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 /* not strictly preprocessor, but we test it there */187 /* not strictly preprocessor, but we test it there */
162#ifdef C99_MACROS188#ifdef C99_MACROS
163 printf("__func__ = %s\n", __func__);189 printf("__func__ = %s\n", __func__);
@@ -428,7 +454,9 @@ void array_test(int a[4]) · 264 unmodified lines
428 printf("sizeof(char) = %d\n", sizeof(char));454 printf("sizeof(char) = %d\n", sizeof(char));
429 printf("sizeof(unsigned char) = %d\n", sizeof(unsigned char));455 printf("sizeof(unsigned char) = %d\n", sizeof(unsigned char));
430 printf("sizeof(\"a\") = %d\n", sizeof("a"));456 printf("sizeof(\"a\") = %d\n", sizeof("a"));
457#ifdef C99_MACROS
431 printf("sizeof(__func__) = %d\n", sizeof(__func__));458 printf("sizeof(__func__) = %d\n", sizeof(__func__));
459#endif
432 printf("sizeof tab %d\n", sizeof(tab));460 printf("sizeof tab %d\n", sizeof(tab));
433 printf("sizeof tab2 %d\n", sizeof tab2);461 printf("sizeof tab2 %d\n", sizeof tab2);
434 tab[0] = 1;462 tab[0] = 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t