diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-04-03 00:10:45 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-03 09:10:45 +0200 |
commit | 93cd98dd143d45a31a7fd90ad8f0b3d3c4c7798f (patch) | |
tree | ed8311a247e5957c54a3fed8de5101c6c56e6cf6 /tinyc/tests/pp | |
parent | 6b9ffc7fadcdaeccd971230733607761863946f0 (diff) | |
download | Nim-93cd98dd143d45a31a7fd90ad8f0b3d3c4c7798f.tar.gz |
move tinyc to a separate repo and allow installing external dependencency (eg tinyc) from koch / library code (#13850)
* remove tinyc * installDeps * update tinyc paths
Diffstat (limited to 'tinyc/tests/pp')
44 files changed, 0 insertions, 478 deletions
diff --git a/tinyc/tests/pp/01.c b/tinyc/tests/pp/01.c deleted file mode 100644 index 2fc3d7960..000000000 --- a/tinyc/tests/pp/01.c +++ /dev/null @@ -1,6 +0,0 @@ -#define hash_hash # ## # -#define mkstr(a) # a -#define in_between(a) mkstr(a) -#define join(c, d) in_between(c hash_hash d) -char p[] = join(x, y); -// char p[] = "x ## y"; diff --git a/tinyc/tests/pp/01.expect b/tinyc/tests/pp/01.expect deleted file mode 100644 index cf5b15340..000000000 --- a/tinyc/tests/pp/01.expect +++ /dev/null @@ -1 +0,0 @@ -char p[] = "x ## y"; diff --git a/tinyc/tests/pp/02.c b/tinyc/tests/pp/02.c deleted file mode 100644 index feb1254e3..000000000 --- a/tinyc/tests/pp/02.c +++ /dev/null @@ -1,28 +0,0 @@ -#define x 3 -#define f(a) f(x * (a)) -#undef x -#define x 2 -#define g f -#define z z[0] -#define h g(~ -#define m(a) a(w) -#define w 0,1 -#define t(a) a -#define p() int -#define q(x) x -#define r(x,y) x ## y -#define str(x) # x -f(y+1) + f(f(z)) % t(t(g)(0) + t)(1); -g(x+(3,4)-w) | h 5) & m -(f)^m(m); -char c[2][6] = { str(hello), str() }; -/* - * 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); - * char c[2][6] = { "hello", "" }; - */ -#define L21 f(y+1) + f(f(z)) % t(t(g)(0) + t)(1); -#define L22 g(x+(3,4)-w) | h 5) & m\ -(f)^m(m); -L21 -L22 diff --git a/tinyc/tests/pp/02.expect b/tinyc/tests/pp/02.expect deleted file mode 100644 index 8ae2eb9ea..000000000 --- a/tinyc/tests/pp/02.expect +++ /dev/null @@ -1,5 +0,0 @@ -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); -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); diff --git a/tinyc/tests/pp/03.c b/tinyc/tests/pp/03.c deleted file mode 100644 index a659245ec..000000000 --- a/tinyc/tests/pp/03.c +++ /dev/null @@ -1,15 +0,0 @@ -#define str(s) # s -#define xstr(s) str(s) -#define debug(s, t) printf("x" # s "= %d, x" # t "= %s", \ - x ## s, x ## t) -#define INCFILE(n) vers ## n -#define glue(a, b) a ## b -#define xglue(a, b) glue(a, b) -#define HIGHLOW "hello" -#define LOW LOW ", world" -debug(1, 2); -fputs(str(strncmp("abc\0d", "abc", '\4') // this goes away - == 0) str(: @\n), s); -\#include xstr(INCFILE(2).h) -glue(HIGH, LOW); -xglue(HIGH, LOW) diff --git a/tinyc/tests/pp/03.expect b/tinyc/tests/pp/03.expect deleted file mode 100644 index 44aad0ae1..000000000 --- a/tinyc/tests/pp/03.expect +++ /dev/null @@ -1,5 +0,0 @@ -printf("x" "1" "= %d, x" "2" "= %s", x1, x2); -fputs("strncmp(\"abc\\0d\", \"abc\", '\\4') == 0" ": @\n", s); -\#include "vers2.h" -"hello"; -"hello" ", world" diff --git a/tinyc/tests/pp/04.c b/tinyc/tests/pp/04.c deleted file mode 100644 index 0068f3751..000000000 --- a/tinyc/tests/pp/04.c +++ /dev/null @@ -1,4 +0,0 @@ -#define foobar 1 -#define C(x,y) x##y -#define D(x) (C(x,bar)) -D(foo) diff --git a/tinyc/tests/pp/04.expect b/tinyc/tests/pp/04.expect deleted file mode 100644 index 7c67b0104..000000000 --- a/tinyc/tests/pp/04.expect +++ /dev/null @@ -1 +0,0 @@ -(1) diff --git a/tinyc/tests/pp/05.c b/tinyc/tests/pp/05.c deleted file mode 100644 index 72749416c..000000000 --- a/tinyc/tests/pp/05.c +++ /dev/null @@ -1,7 +0,0 @@ -#define t(x,y,z) x ## y ## z -#define xxx(s) int s[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), \ - t(10,,), t(,11,), t(,,12), t(,,) }; - -int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), - t(10,,), t(,11,), t(,,12), t(,,) }; -xxx(j) diff --git a/tinyc/tests/pp/05.expect b/tinyc/tests/pp/05.expect deleted file mode 100644 index 9f9be378f..000000000 --- a/tinyc/tests/pp/05.expect +++ /dev/null @@ -1,3 +0,0 @@ -int j[] = { 123, 45, 67, 89, - 10, 11, 12, }; -int j[] = { 123, 45, 67, 89, 10, 11, 12, }; diff --git a/tinyc/tests/pp/06.c b/tinyc/tests/pp/06.c deleted file mode 100644 index 28cfddece..000000000 --- a/tinyc/tests/pp/06.c +++ /dev/null @@ -1,5 +0,0 @@ -#define X(a,b, \ - c,d) \ - foo - -X(1,2,3,4) diff --git a/tinyc/tests/pp/06.expect b/tinyc/tests/pp/06.expect deleted file mode 100644 index 257cc5642..000000000 --- a/tinyc/tests/pp/06.expect +++ /dev/null @@ -1 +0,0 @@ -foo diff --git a/tinyc/tests/pp/07.c b/tinyc/tests/pp/07.c deleted file mode 100644 index b22b22bbc..000000000 --- a/tinyc/tests/pp/07.c +++ /dev/null @@ -1,4 +0,0 @@ -#define a() YES -#define b() a -b() -b()() diff --git a/tinyc/tests/pp/07.expect b/tinyc/tests/pp/07.expect deleted file mode 100644 index ad0e20a66..000000000 --- a/tinyc/tests/pp/07.expect +++ /dev/null @@ -1,2 +0,0 @@ -a -YES diff --git a/tinyc/tests/pp/08.c b/tinyc/tests/pp/08.c deleted file mode 100644 index 93018e11f..000000000 --- a/tinyc/tests/pp/08.c +++ /dev/null @@ -1,4 +0,0 @@ -// test macro expansion in arguments -#define s_pos s_s.s_pos -#define foo(x) (x) -foo(hej.s_pos) diff --git a/tinyc/tests/pp/08.expect b/tinyc/tests/pp/08.expect deleted file mode 100644 index 2b2e3eebd..000000000 --- a/tinyc/tests/pp/08.expect +++ /dev/null @@ -1 +0,0 @@ -(hej.s_s.s_pos) diff --git a/tinyc/tests/pp/09.c b/tinyc/tests/pp/09.c deleted file mode 100644 index 315b297cd..000000000 --- a/tinyc/tests/pp/09.c +++ /dev/null @@ -1,4 +0,0 @@ -#define C(a,b,c) a##b##c -#define N(x,y) C(x,_,y) -#define A_O aaaaoooo -N(A,O) diff --git a/tinyc/tests/pp/09.expect b/tinyc/tests/pp/09.expect deleted file mode 100644 index adce0f95e..000000000 --- a/tinyc/tests/pp/09.expect +++ /dev/null @@ -1 +0,0 @@ -aaaaoooo diff --git a/tinyc/tests/pp/10.c b/tinyc/tests/pp/10.c deleted file mode 100644 index f180eff1e..000000000 --- a/tinyc/tests/pp/10.c +++ /dev/null @@ -1,10 +0,0 @@ -#define f(x) x -#define g(x) f(x) f(x -#define i(x) g(x)) g(x -#define h(x) i(x))) i(x -#define k(x) i(x))) i(x)))) -f(x) -g(x)) -i(x))) -h(x)))) -k(x)))) diff --git a/tinyc/tests/pp/10.expect b/tinyc/tests/pp/10.expect deleted file mode 100644 index bd18e18e5..000000000 --- a/tinyc/tests/pp/10.expect +++ /dev/null @@ -1,5 +0,0 @@ -x -x x -x x x x -x x x x x x x x -x x x x x x x x)))) diff --git a/tinyc/tests/pp/11.c b/tinyc/tests/pp/11.c deleted file mode 100644 index c0edf629c..000000000 --- a/tinyc/tests/pp/11.c +++ /dev/null @@ -1,31 +0,0 @@ -#define D1(s, ...) s -#define D2(s, ...) s D1(__VA_ARGS__) -#define D3(s, ...) s D2(__VA_ARGS__) -#define D4(s, ...) s D3(__VA_ARGS__) - -D1(a) -D2(a, b) -D3(a, b, c) -D4(a, b, c, d) - -x D4(a, b, c, d) y -x D4(a, b, c) y -x D4(a, b) y -x D4(a) y -x D4() y - -#define GNU_COMMA(X,Y...) X,## Y - -x GNU_COMMA(A,B,C) y -x GNU_COMMA(A,B) y -x GNU_COMMA(A) y -x GNU_COMMA() y - -#define __sun_attr___noreturn__ __attribute__((__noreturn__)) -#define ___sun_attr_inner(__a) __sun_attr_##__a -#define __sun_attr__(__a) ___sun_attr_inner __a -#define __NORETURN __sun_attr__((__noreturn__)) -__NORETURN -#define X(...) -#define Y(...) 1 __VA_ARGS__ 2 -Y(X X() ()) diff --git a/tinyc/tests/pp/11.expect b/tinyc/tests/pp/11.expect deleted file mode 100644 index 6b9806c6c..000000000 --- a/tinyc/tests/pp/11.expect +++ /dev/null @@ -1,15 +0,0 @@ -a -a b -a b c -a b c d -x a b c d y -x a b c y -x a b y -x a y -x y -x A,B,C y -x A,B y -x A y -x y -__attribute__((__noreturn__)) -1 2 diff --git a/tinyc/tests/pp/12.S b/tinyc/tests/pp/12.S deleted file mode 100644 index 597ccb4cb..000000000 --- a/tinyc/tests/pp/12.S +++ /dev/null @@ -1,8 +0,0 @@ -#define SRC(y...) \ - 9999: y; \ - .section __ex_table, "a"; \ - .long 9999b, 6001f ; \ - // .previous - - SRC(1: movw (%esi), %bx) -6001: diff --git a/tinyc/tests/pp/12.expect b/tinyc/tests/pp/12.expect deleted file mode 100644 index 17a861c25..000000000 --- a/tinyc/tests/pp/12.expect +++ /dev/null @@ -1,2 +0,0 @@ - 9999: 1: movw (%esi), %bx; .section __ex_table, "a"; .long 9999b, 6001f ; -6001: diff --git a/tinyc/tests/pp/13.S b/tinyc/tests/pp/13.S deleted file mode 100644 index bf0b525f9..000000000 --- a/tinyc/tests/pp/13.S +++ /dev/null @@ -1,6 +0,0 @@ -# `modelist' label. Each video mode record looks like: -#ifdef AAA -# modelist' label. Each video mode record looks like: -#endif -.text -endtext: diff --git a/tinyc/tests/pp/13.expect b/tinyc/tests/pp/13.expect deleted file mode 100644 index c7a32305f..000000000 --- a/tinyc/tests/pp/13.expect +++ /dev/null @@ -1,2 +0,0 @@ -.text -endtext: diff --git a/tinyc/tests/pp/14.c b/tinyc/tests/pp/14.c deleted file mode 100644 index e15468c5f..000000000 --- a/tinyc/tests/pp/14.c +++ /dev/null @@ -1,13 +0,0 @@ -#define W Z -#define Z(X) W(X,2) -#define Y(X) Z(X) -#define X Y -return X(X(1)); - -#define P Q -#define Q(n) P(n,2) -return P(1); - -#define A (B * B) -#define B (A + A) -return A + B; diff --git a/tinyc/tests/pp/14.expect b/tinyc/tests/pp/14.expect deleted file mode 100644 index 37860440c..000000000 --- a/tinyc/tests/pp/14.expect +++ /dev/null @@ -1,3 +0,0 @@ -return Z(Z(1,2),2); -return Q(1,2); -return ((A + A) * (A + A)) + ((B * B) + (B * B)); diff --git a/tinyc/tests/pp/15.c b/tinyc/tests/pp/15.c deleted file mode 100644 index cf13f9a89..000000000 --- a/tinyc/tests/pp/15.c +++ /dev/null @@ -1,18 +0,0 @@ -// 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; - -// unlike gcc, but cannot appear in valid C -// XXX: return n(x)n(x)n(1)n(2)n(x); diff --git a/tinyc/tests/pp/15.expect b/tinyc/tests/pp/15.expect deleted file mode 100644 index b4f885e95..000000000 --- a/tinyc/tests/pp/15.expect +++ /dev/null @@ -1,5 +0,0 @@ -return (long double)d; -return A+++B; -return A+ ++B; -return A+++ +B; -return 0x1E -1; diff --git a/tinyc/tests/pp/16.c b/tinyc/tests/pp/16.c deleted file mode 100644 index 8b5b6428c..000000000 --- a/tinyc/tests/pp/16.c +++ /dev/null @@ -1,3 +0,0 @@ -/* The following should warn */ -#define A ... -#define A <<= diff --git a/tinyc/tests/pp/16.expect b/tinyc/tests/pp/16.expect deleted file mode 100644 index 695d6d41c..000000000 --- a/tinyc/tests/pp/16.expect +++ /dev/null @@ -1,2 +0,0 @@ - -16.c:3: warning: A redefined diff --git a/tinyc/tests/pp/17.c b/tinyc/tests/pp/17.c deleted file mode 100644 index f12196fe8..000000000 --- a/tinyc/tests/pp/17.c +++ /dev/null @@ -1,14 +0,0 @@ -#define STR1(u) # u -#define pass(a) a -#define __ASM_REG(reg) STR1(one##reg) -#define _ASM_DX __ASM_REG(tok) -X162 pass(__ASM_REG(tok)) -X161 pass(_ASM_DX) -X163 pass(STR1(one##tok)) - -X170 pass(x ## y) -X171 pass(x pass(##) y) - -#define Y(x) Z(x) -#define X Y -X180 return X(X(1)); diff --git a/tinyc/tests/pp/17.expect b/tinyc/tests/pp/17.expect deleted file mode 100644 index e95aafef8..000000000 --- a/tinyc/tests/pp/17.expect +++ /dev/null @@ -1,6 +0,0 @@ -X162 "onetok" -X161 "onetok" -X163 "one##tok" -X170 x ## y -X171 x ## y -X180 return Z(Z(1)); diff --git a/tinyc/tests/pp/18.c b/tinyc/tests/pp/18.c deleted file mode 100644 index 0961426ac..000000000 --- a/tinyc/tests/pp/18.c +++ /dev/null @@ -1,15 +0,0 @@ -#define M_RETI_ARG27(x,y,z,aa, ...) aa -#define M_RET_ARG27(...) M_RETI_ARG27(__VA_ARGS__) -#define M_COMMA_P(...) M_RET_ARG27(__VA_ARGS__, 1, 1, 0, useless) -#define M_EMPTYI_DETECT(...) 0, 1, -#define M_EMPTYI_P_C1(...) M_COMMA_P(M_EMPTYI_DETECT __VA_ARGS__ () ) -#define EX -#define empty(x) -#define fnlike(x) yeah x -/* If the following macro is called with empty arg (X183), the use - of 'x' between fnlike and '(' doesn't hinder the recognition of this - being a further fnlike macro invocation. */ -#define usefnlike(x) fnlike x (x) -X181 M_EMPTYI_P_C1() -X182 M_EMPTYI_P_C1(x) -X183 usefnlike() diff --git a/tinyc/tests/pp/18.expect b/tinyc/tests/pp/18.expect deleted file mode 100644 index 447a9b2ed..000000000 --- a/tinyc/tests/pp/18.expect +++ /dev/null @@ -1,3 +0,0 @@ -X181 1 -X182 0 -X183 yeah diff --git a/tinyc/tests/pp/19.c b/tinyc/tests/pp/19.c deleted file mode 100644 index aa91abe0d..000000000 --- a/tinyc/tests/pp/19.c +++ /dev/null @@ -1,101 +0,0 @@ -#define M_C2I(a, ...) a ## __VA_ARGS__ -#define M_C(a, ...) M_C2I(a, __VA_ARGS__) -#define M_C3I(a, b, ...) a ## b ## __VA_ARGS__ -#define M_C3(a, b, ...) M_C3I(a ,b, __VA_ARGS__) - -#define M_RETI_ARG2(a, b, ...) b -#define M_RET_ARG2(...) M_RETI_ARG2(__VA_ARGS__) -#define M_RETI_ARG27(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa, ...) aa -#define M_RET_ARG27(...) M_RETI_ARG27(__VA_ARGS__) - -#define M_TOBOOLI_0 1, 0, -#define M_BOOL(x) M_RET_ARG2(M_C(M_TOBOOLI_, x), 1, useless) - -#define M_IFI_0(true_macro, ...) __VA_ARGS__ -#define M_IFI_1(true_macro, ...) true_macro -#define M_IF(c) M_C(M_IFI_, M_BOOL(c)) - -#define M_FLAT(...) __VA_ARGS__ -#define M_INVI_0 1 -#define M_INVI_1 0 -#define M_INV(x) M_C(M_INVI_, x) - -#define M_ANDI_00 0 -#define M_ANDI_01 0 -#define M_ANDI_10 0 -#define M_ANDI_11 1 -#define M_AND(x,y) M_C3(M_ANDI_, x, y) - -#define M_ORI_00 0 -#define M_ORI_01 1 -#define M_ORI_10 1 -#define M_ORI_11 1 -#define M_OR(x,y) M_C3(M_ORI_, x, y) - -#define M_COMMA_P(...) M_RET_ARG27(__VA_ARGS__, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, useless) - -#define M_EMPTYI_DETECT(...) 0, 1, -#define M_EMPTYI_P_C1(...) M_COMMA_P(M_EMPTYI_DETECT __VA_ARGS__ ()) -#define M_EMPTYI_P_C2(...) M_COMMA_P(M_EMPTYI_DETECT __VA_ARGS__) -#define M_EMPTYI_P_C3(...) M_COMMA_P(__VA_ARGS__ () ) -#define M_EMPTY_P(...) M_AND(M_EMPTYI_P_C1(__VA_ARGS__), M_INV(M_OR(M_OR(M_EMPTYI_P_C2(__VA_ARGS__), M_COMMA_P(__VA_ARGS__)),M_EMPTYI_P_C3(__VA_ARGS__)))) -#define M_APPLY_FUNC2B(func, arg1, arg2) \ - M_IF(M_EMPTY_P(arg2))(,func(arg1, arg2)) -#define M_MAP2B_0(func, data, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z,...) \ - M_APPLY_FUNC2B(func, data, a) M_APPLY_FUNC2B(func, data, b) M_APPLY_FUNC2B(func, data, c) \ - M_APPLY_FUNC2B(func, data, d) M_APPLY_FUNC2B(func, data, e) M_APPLY_FUNC2B(func, data, f) \ - M_APPLY_FUNC2B(func, data, g) M_APPLY_FUNC2B(func, data, h) M_APPLY_FUNC2B(func, data, i) \ - M_APPLY_FUNC2B(func, data, j) M_APPLY_FUNC2B(func, data, k) M_APPLY_FUNC2B(func, data, l) \ - M_APPLY_FUNC2B(func, data, m) M_APPLY_FUNC2B(func, data, n) M_APPLY_FUNC2B(func, data, o) \ - M_APPLY_FUNC2B(func, data, p) M_APPLY_FUNC2B(func, data, q) M_APPLY_FUNC2B(func, data, r) \ - M_APPLY_FUNC2B(func, data, s) M_APPLY_FUNC2B(func, data, t) M_APPLY_FUNC2B(func, data, u) \ - M_APPLY_FUNC2B(func, data, v) M_APPLY_FUNC2B(func, data, w) M_APPLY_FUNC2B(func, data, x) \ - M_APPLY_FUNC2B(func, data, y) M_APPLY_FUNC2B(func, data, z) -#define M_MAP2B(f, ...) M_MAP2B_0(f, __VA_ARGS__, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ) -#define M_INIT_INIT(a) ,a, - -#define M_GET_METHOD(method, method_default, ...) \ - M_RET_ARG2 (M_MAP2B(M_C, M_C3(M_, method, _), __VA_ARGS__), method_default,) - -#define M_TEST_METHOD_P(method, oplist) \ - M_BOOL(M_GET_METHOD (method, 0, M_FLAT oplist)) - -#define TRUE 1 -#define TEST1(n) \ - M_IF(n)(ok,nok) -#define TEST2(op) \ - M_TEST_METHOD_P(INIT, op) -#define TEST3(op) \ - M_IF(M_TEST_METHOD_P(INIT, op))(ok, nok) -#define TEST4(op) \ - TEST1(TEST2(op)) -#define KO(a) ((void)1) - -/* This checks that the various expansions that ultimately lead to - something like 'KO(arg,arg)', where 'KO' comes from a macro - expansion reducing from a large macro chain do not are regarded - as funclike macro invocation of KO. E.g. X93 and X94 expand to 'KO', - but X95 must not consume the (a,b) arguments outside the M_IF() - invocation to reduce the 'KO' macro to an invocation. Instead - X95 should reduce via M_IF(KO)(a,b) to 'a'. - - The other lines here are variations on this scheme, with X1 to - X6 coming from the bug report at - http://lists.nongnu.org/archive/html/tinycc-devel/2017-07/msg00017.html */ -X92 M_IF(KO) -X93 M_GET_METHOD(INIT, 0, INIT(KO)) -X94 M_GET_METHOD(INIT, 0, M_FLAT (INIT(KO))) -X95 M_IF(M_GET_METHOD(INIT, 0, INIT(KO)))(a,b) -X96 M_IF(M_GET_METHOD(INIT, 0, M_FLAT (INIT(KO)))) -X97 M_IF(M_GET_METHOD(INIT, 0, M_FLAT (INIT(KO))))(ok,nok) -X98 (M_TEST_METHOD_P(INIT, (INIT(KO))))(ok, nok) -X99 M_IF(M_TEST_METHOD_P(INIT, (INIT(KO))))(ok, nok) -// test begins -X1 TEST1(TRUE) // ==> expect ok, get ok -// First test with a token which is not a macro -X2 TEST2((INIT(ok))) // ==> expect 1, get 1 -X3 TEST3((INIT(ok))) // ==> expect ok, get ok -// Then test with a token which is a macro, but should not be expanded. -X4 TEST2((INIT(KO))) // ==> expect 1, get 1 -X5 TEST4(INIT(KO)) -X6 TEST3((INIT(KO))) // ==> expect ok, get "error: macro 'KO' used with too many args" diff --git a/tinyc/tests/pp/19.expect b/tinyc/tests/pp/19.expect deleted file mode 100644 index 08c08581e..000000000 --- a/tinyc/tests/pp/19.expect +++ /dev/null @@ -1,14 +0,0 @@ -X92 M_IFI_1 -X93 KO -X94 KO -X95 a -X96 M_IFI_1 -X97 ok -X98 (1)(ok, nok) -X99 ok -X1 ok -X2 1 -X3 ok -X4 1 -X5 nok -X6 ok diff --git a/tinyc/tests/pp/20.c b/tinyc/tests/pp/20.c deleted file mode 100644 index 7944d62bc..000000000 --- a/tinyc/tests/pp/20.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Various things I encountered while hacking the pre processor */ -#define wrap(x) x -#define pr_warning(fmt, ...) printk(KERN_WARNING fmt, ##__VA_ARGS__) -#define pr_warn(x,y) pr_warning(x,y) -#define net_ratelimited_function(function, ...) function(__VA_ARGS__) -X1 net_ratelimited_function(pr_warn, "pipapo", bla); -X2 net_ratelimited_function(wrap(pr_warn), "bla", foo); -#define two m n -#define chain4(a,b,c,d) a ## b ## c ## d -X2 chain4(two,o,p,q) -X3 chain4(o,two,p,q) -X4 chain4(o,p,two,q) -X5 chain4(o,p,q,two) diff --git a/tinyc/tests/pp/20.expect b/tinyc/tests/pp/20.expect deleted file mode 100644 index d19405d74..000000000 --- a/tinyc/tests/pp/20.expect +++ /dev/null @@ -1,6 +0,0 @@ -X1 printk(KERN_WARNING "pipapo",bla); -X2 printk(KERN_WARNING "bla",foo); -X2 twoopq -X3 otwopq -X4 optwoq -X5 opqtwo diff --git a/tinyc/tests/pp/21.c b/tinyc/tests/pp/21.c deleted file mode 100644 index 1316226a2..000000000 --- a/tinyc/tests/pp/21.c +++ /dev/null @@ -1,36 +0,0 @@ -/* accept 'defined' as result of substitution */ - ------ 1 ------ -#define AAA 2 -#define BBB -#define CCC (defined ( AAA ) && AAA > 1 && !defined BBB) -#if !CCC -OK -#else -NOT OK -#endif - ------ 2 ------ -#undef BBB -#if CCC -OK -#else -NOT OK -#endif - ------ 3 ------ -#define DEFINED defined -#define DDD (DEFINED ( AAA ) && AAA > 1 && !DEFINED BBB) -#if (DDD) -OK -#else -NOT OK -#endif - ------ 4 ------ -#undef AAA -#if !(DDD) -OK -#else -NOT OK -#endif diff --git a/tinyc/tests/pp/21.expect b/tinyc/tests/pp/21.expect deleted file mode 100644 index 5a1376bb1..000000000 --- a/tinyc/tests/pp/21.expect +++ /dev/null @@ -1,8 +0,0 @@ ------ 1 ------ -OK ------ 2 ------ -OK ------ 3 ------ -OK ------ 4 ------ -OK diff --git a/tinyc/tests/pp/pp-counter.c b/tinyc/tests/pp/pp-counter.c deleted file mode 100644 index 3978e1a7e..000000000 --- a/tinyc/tests/pp/pp-counter.c +++ /dev/null @@ -1,27 +0,0 @@ -X1 __COUNTER__ -X2 __COUNTER__ -#if __COUNTER__ -X3 __COUNTER__ -#endif -#define pass(x) x -#define a x __COUNTER__ y -#define a2 pass(__COUNTER__) -#define f(c) c __COUNTER__ -#define apply(d) d d __COUNTER__ x2 f(d) y2 __COUNTER__ -#define _paste(a,b) a ## b -#define paste(a,b) _paste(a,b) -#define _paste3(a,b,c) a ## b ## c -#define doublepaste(a,b) _paste3(a,b,b) -#define str(x) #x -X4 a -X5 f(a) -X6 f(b) -X7 f(__COUNTER__) -X8 apply(a) -X9 apply(f(a)) -X10 apply(__COUNTER__) -X11 apply(a2) -X12 str(__COUNTER__) -X13 paste(x,__COUNTER__) -X14 _paste(x,__COUNTER__) -X15 doublepaste(x,__COUNTER__) diff --git a/tinyc/tests/pp/pp-counter.expect b/tinyc/tests/pp/pp-counter.expect deleted file mode 100644 index 02fc535bc..000000000 --- a/tinyc/tests/pp/pp-counter.expect +++ /dev/null @@ -1,15 +0,0 @@ -X1 0 -X2 1 -X3 3 -X4 x 4 y -X5 x 5 y 6 -X6 b 7 -X7 8 9 -X8 x 10 y x 10 y 11 x2 x 10 y 12 y2 13 -X9 x 14 y 15 x 14 y 15 16 x2 x 14 y 15 17 y2 18 -X10 19 19 20 x2 19 21 y2 22 -X11 23 23 24 x2 23 25 y2 26 -X12 "__COUNTER__" -X13 x27 -X14 x__COUNTER__ -X15 x2828 |