tccpp : "tcc -E -P" : suppress empty lines

Also:
- regenerate all tests/pp/*.expect with gcc
- test "insert one space" feature
- test "0x1E-1" in asm mode case
- PARSE_FLAG_SPACES: ignore \f\v\r better
- tcc.h: move some things
This commit is contained in:
grischka
2016-10-09 20:33:14 +02:00
parent 78c08898ae
commit 71b16f4e18
9 changed files with 82 additions and 89 deletions

View File

@ -1,6 +1,5 @@
f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
f(2 * (2 +(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
char c[2][6] = { "hello", "" };
f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
f(2 * (2 +(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);

View File

@ -1,6 +1,3 @@
# `modelist' label. Each video mode record looks like:
.text
endtext:

18
tests/pp/15.c Normal file
View File

@ -0,0 +1,18 @@
// insert a space between two tokens if otherwise they
// would form a single token when read back
#define n(x) x
return (n(long)n(double))d;
return n(A)n(++)n(+)n(B);
return n(A)n(+)n(++)n(B);
return n(A)n(++)n(+)n(+)n(B);
// not a hex float
return n(0x1E)n(-1);
// unlike gcc but correct
XXX: return n(x)+n(x)-n(1)+n(1)-2;
// unlile gcc, but cannot appear in valid C
XXX: return n(x)n(x)n(1)n(2)n(x);

7
tests/pp/15.expect Normal file
View File

@ -0,0 +1,7 @@
return (long double)d;
return A+++B;
return A+ ++B;
return A+++ +B;
return 0x1E -1;
XXX: return x+x-1 +1 -2;
XXX: return x x 1 2 x;

View File

@ -40,8 +40,8 @@ DIFF_OPTS = -Nu -b -B -I "^\#"
clean:
rm -vf *.output
# 02.test : DIFF_OPTS += -w
# 15.test : DIFF_OPTS += -w
02.test : DIFF_OPTS += -w
15.test : DIFF_OPTS += -I"^XXX:"
# diff options:
# -b ighore space changes

View File

@ -2573,6 +2573,10 @@ void asm_test(void)
{
char buf[128];
unsigned int val;
printf("inline asm:\n");
// parse 0x1E-1 as 3 tokens in asm mode
asm volatile ("mov $0x1E-1,%eax");
/* test the no operand case */