diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2010-06-21 11:22:11 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2010-06-21 11:22:11 -0700 |
commit | 6f510a49d2f3271432844d6b7e2bfe459b2126d4 (patch) | |
tree | 7ad316228b4353bbdf0070d61a754b84b29c1a30 /glcpp/tests | |
parent | f3eb42d200bb78afae64af6862e2b12396226707 (diff) | |
parent | 2fb30a2e492e466a7b383e8ca430ba7371b443ee (diff) |
Merge Carl's preprocessor into the glcpp subdirectory.
Diffstat (limited to 'glcpp/tests')
135 files changed, 782 insertions, 0 deletions
diff --git a/glcpp/tests/000-content-with-spaces.c b/glcpp/tests/000-content-with-spaces.c new file mode 100644 index 0000000000..696cb3a74f --- /dev/null +++ b/glcpp/tests/000-content-with-spaces.c @@ -0,0 +1 @@ +this is four tokens diff --git a/glcpp/tests/000-content-with-spaces.c.expected b/glcpp/tests/000-content-with-spaces.c.expected new file mode 100644 index 0000000000..a7fc918c90 --- /dev/null +++ b/glcpp/tests/000-content-with-spaces.c.expected @@ -0,0 +1 @@ +this is four tokens diff --git a/glcpp/tests/001-define.c b/glcpp/tests/001-define.c new file mode 100644 index 0000000000..cbf2fee0e7 --- /dev/null +++ b/glcpp/tests/001-define.c @@ -0,0 +1,2 @@ +#define foo 1 +foo diff --git a/glcpp/tests/001-define.c.expected b/glcpp/tests/001-define.c.expected new file mode 100644 index 0000000000..a464d9da74 --- /dev/null +++ b/glcpp/tests/001-define.c.expected @@ -0,0 +1,2 @@ + +1 diff --git a/glcpp/tests/002-define-chain.c b/glcpp/tests/002-define-chain.c new file mode 100644 index 0000000000..87d75c6875 --- /dev/null +++ b/glcpp/tests/002-define-chain.c @@ -0,0 +1,3 @@ +#define foo 1 +#define bar foo +bar diff --git a/glcpp/tests/002-define-chain.c.expected b/glcpp/tests/002-define-chain.c.expected new file mode 100644 index 0000000000..c6c9ee38a9 --- /dev/null +++ b/glcpp/tests/002-define-chain.c.expected @@ -0,0 +1,3 @@ + + +1 diff --git a/glcpp/tests/003-define-chain-reverse.c b/glcpp/tests/003-define-chain-reverse.c new file mode 100644 index 0000000000..a18b724eca --- /dev/null +++ b/glcpp/tests/003-define-chain-reverse.c @@ -0,0 +1,3 @@ +#define bar foo +#define foo 1 +bar diff --git a/glcpp/tests/003-define-chain-reverse.c.expected b/glcpp/tests/003-define-chain-reverse.c.expected new file mode 100644 index 0000000000..c6c9ee38a9 --- /dev/null +++ b/glcpp/tests/003-define-chain-reverse.c.expected @@ -0,0 +1,3 @@ + + +1 diff --git a/glcpp/tests/004-define-recursive.c b/glcpp/tests/004-define-recursive.c new file mode 100644 index 0000000000..2ac56ea3dc --- /dev/null +++ b/glcpp/tests/004-define-recursive.c @@ -0,0 +1,6 @@ +#define foo bar +#define bar baz +#define baz foo +foo +bar +baz diff --git a/glcpp/tests/004-define-recursive.c.expected b/glcpp/tests/004-define-recursive.c.expected new file mode 100644 index 0000000000..2d07687f8c --- /dev/null +++ b/glcpp/tests/004-define-recursive.c.expected @@ -0,0 +1,6 @@ + + + +foo +bar +baz diff --git a/glcpp/tests/005-define-composite-chain.c b/glcpp/tests/005-define-composite-chain.c new file mode 100644 index 0000000000..f5521df968 --- /dev/null +++ b/glcpp/tests/005-define-composite-chain.c @@ -0,0 +1,3 @@ +#define foo 1 +#define bar a foo +bar diff --git a/glcpp/tests/005-define-composite-chain.c.expected b/glcpp/tests/005-define-composite-chain.c.expected new file mode 100644 index 0000000000..892975c268 --- /dev/null +++ b/glcpp/tests/005-define-composite-chain.c.expected @@ -0,0 +1,3 @@ + + +a 1 diff --git a/glcpp/tests/006-define-composite-chain-reverse.c b/glcpp/tests/006-define-composite-chain-reverse.c new file mode 100644 index 0000000000..4bb91a1221 --- /dev/null +++ b/glcpp/tests/006-define-composite-chain-reverse.c @@ -0,0 +1,3 @@ +#define bar a foo +#define foo 1 +bar diff --git a/glcpp/tests/006-define-composite-chain-reverse.c.expected b/glcpp/tests/006-define-composite-chain-reverse.c.expected new file mode 100644 index 0000000000..892975c268 --- /dev/null +++ b/glcpp/tests/006-define-composite-chain-reverse.c.expected @@ -0,0 +1,3 @@ + + +a 1 diff --git a/glcpp/tests/007-define-composite-recursive.c b/glcpp/tests/007-define-composite-recursive.c new file mode 100644 index 0000000000..5784565bdf --- /dev/null +++ b/glcpp/tests/007-define-composite-recursive.c @@ -0,0 +1,6 @@ +#define foo a bar +#define bar b baz +#define baz c foo +foo +bar +baz diff --git a/glcpp/tests/007-define-composite-recursive.c.expected b/glcpp/tests/007-define-composite-recursive.c.expected new file mode 100644 index 0000000000..0b0b477d9d --- /dev/null +++ b/glcpp/tests/007-define-composite-recursive.c.expected @@ -0,0 +1,6 @@ + + + +a b c foo +b c a bar +c a b baz diff --git a/glcpp/tests/008-define-empty.c b/glcpp/tests/008-define-empty.c new file mode 100644 index 0000000000..b1bd17ec21 --- /dev/null +++ b/glcpp/tests/008-define-empty.c @@ -0,0 +1,2 @@ +#define foo +foo diff --git a/glcpp/tests/008-define-empty.c.expected b/glcpp/tests/008-define-empty.c.expected new file mode 100644 index 0000000000..139597f9cb --- /dev/null +++ b/glcpp/tests/008-define-empty.c.expected @@ -0,0 +1,2 @@ + + diff --git a/glcpp/tests/009-undef.c b/glcpp/tests/009-undef.c new file mode 100644 index 0000000000..3fc1fb4424 --- /dev/null +++ b/glcpp/tests/009-undef.c @@ -0,0 +1,4 @@ +#define foo 1 +foo +#undef foo +foo diff --git a/glcpp/tests/009-undef.c.expected b/glcpp/tests/009-undef.c.expected new file mode 100644 index 0000000000..9c0b35a451 --- /dev/null +++ b/glcpp/tests/009-undef.c.expected @@ -0,0 +1,4 @@ + +1 + +foo diff --git a/glcpp/tests/010-undef-re-define.c b/glcpp/tests/010-undef-re-define.c new file mode 100644 index 0000000000..32ff73798b --- /dev/null +++ b/glcpp/tests/010-undef-re-define.c @@ -0,0 +1,6 @@ +#define foo 1 +foo +#undef foo +foo +#define foo 2 +foo diff --git a/glcpp/tests/010-undef-re-define.c.expected b/glcpp/tests/010-undef-re-define.c.expected new file mode 100644 index 0000000000..5970f49028 --- /dev/null +++ b/glcpp/tests/010-undef-re-define.c.expected @@ -0,0 +1,6 @@ + +1 + +foo + +2 diff --git a/glcpp/tests/011-define-func-empty.c b/glcpp/tests/011-define-func-empty.c new file mode 100644 index 0000000000..d9ce13c228 --- /dev/null +++ b/glcpp/tests/011-define-func-empty.c @@ -0,0 +1,2 @@ +#define foo() +foo() diff --git a/glcpp/tests/011-define-func-empty.c.expected b/glcpp/tests/011-define-func-empty.c.expected new file mode 100644 index 0000000000..139597f9cb --- /dev/null +++ b/glcpp/tests/011-define-func-empty.c.expected @@ -0,0 +1,2 @@ + + diff --git a/glcpp/tests/012-define-func-no-args.c b/glcpp/tests/012-define-func-no-args.c new file mode 100644 index 0000000000..c2bb730b11 --- /dev/null +++ b/glcpp/tests/012-define-func-no-args.c @@ -0,0 +1,2 @@ +#define foo() bar +foo() diff --git a/glcpp/tests/012-define-func-no-args.c.expected b/glcpp/tests/012-define-func-no-args.c.expected new file mode 100644 index 0000000000..9f075f2600 --- /dev/null +++ b/glcpp/tests/012-define-func-no-args.c.expected @@ -0,0 +1,2 @@ + +bar diff --git a/glcpp/tests/013-define-func-1-arg-unused.c b/glcpp/tests/013-define-func-1-arg-unused.c new file mode 100644 index 0000000000..f78fb8b118 --- /dev/null +++ b/glcpp/tests/013-define-func-1-arg-unused.c @@ -0,0 +1,2 @@ +#define foo(x) 1 +foo(bar) diff --git a/glcpp/tests/013-define-func-1-arg-unused.c.expected b/glcpp/tests/013-define-func-1-arg-unused.c.expected new file mode 100644 index 0000000000..a464d9da74 --- /dev/null +++ b/glcpp/tests/013-define-func-1-arg-unused.c.expected @@ -0,0 +1,2 @@ + +1 diff --git a/glcpp/tests/014-define-func-2-arg-unused.c b/glcpp/tests/014-define-func-2-arg-unused.c new file mode 100644 index 0000000000..11feb2624b --- /dev/null +++ b/glcpp/tests/014-define-func-2-arg-unused.c @@ -0,0 +1,2 @@ +#define foo(x,y) 1 +foo(bar,baz) diff --git a/glcpp/tests/014-define-func-2-arg-unused.c.expected b/glcpp/tests/014-define-func-2-arg-unused.c.expected new file mode 100644 index 0000000000..a464d9da74 --- /dev/null +++ b/glcpp/tests/014-define-func-2-arg-unused.c.expected @@ -0,0 +1,2 @@ + +1 diff --git a/glcpp/tests/015-define-object-with-parens.c b/glcpp/tests/015-define-object-with-parens.c new file mode 100644 index 0000000000..558da9c617 --- /dev/null +++ b/glcpp/tests/015-define-object-with-parens.c @@ -0,0 +1,4 @@ +#define foo ()1 +foo() +#define bar ()2 +bar() diff --git a/glcpp/tests/015-define-object-with-parens.c.expected b/glcpp/tests/015-define-object-with-parens.c.expected new file mode 100644 index 0000000000..a70321a4c5 --- /dev/null +++ b/glcpp/tests/015-define-object-with-parens.c.expected @@ -0,0 +1,4 @@ + +()1() + +()2() diff --git a/glcpp/tests/016-define-func-1-arg.c b/glcpp/tests/016-define-func-1-arg.c new file mode 100644 index 0000000000..a2e2404c7c --- /dev/null +++ b/glcpp/tests/016-define-func-1-arg.c @@ -0,0 +1,2 @@ +#define foo(x) ((x)+1) +foo(bar) diff --git a/glcpp/tests/016-define-func-1-arg.c.expected b/glcpp/tests/016-define-func-1-arg.c.expected new file mode 100644 index 0000000000..6bfe04f738 --- /dev/null +++ b/glcpp/tests/016-define-func-1-arg.c.expected @@ -0,0 +1,2 @@ + +((bar)+1) diff --git a/glcpp/tests/017-define-func-2-args.c b/glcpp/tests/017-define-func-2-args.c new file mode 100644 index 0000000000..c725383527 --- /dev/null +++ b/glcpp/tests/017-define-func-2-args.c @@ -0,0 +1,2 @@ +#define foo(x,y) ((x)*(y)) +foo(bar,baz) diff --git a/glcpp/tests/017-define-func-2-args.c.expected b/glcpp/tests/017-define-func-2-args.c.expected new file mode 100644 index 0000000000..f7a2b8c26c --- /dev/null +++ b/glcpp/tests/017-define-func-2-args.c.expected @@ -0,0 +1,2 @@ + +((bar)*(baz)) diff --git a/glcpp/tests/018-define-func-macro-as-parameter.c b/glcpp/tests/018-define-func-macro-as-parameter.c new file mode 100644 index 0000000000..668130b8f9 --- /dev/null +++ b/glcpp/tests/018-define-func-macro-as-parameter.c @@ -0,0 +1,3 @@ +#define x 0 +#define foo(x) x +foo(1) diff --git a/glcpp/tests/018-define-func-macro-as-parameter.c.expected b/glcpp/tests/018-define-func-macro-as-parameter.c.expected new file mode 100644 index 0000000000..c6c9ee38a9 --- /dev/null +++ b/glcpp/tests/018-define-func-macro-as-parameter.c.expected @@ -0,0 +1,3 @@ + + +1 diff --git a/glcpp/tests/019-define-func-1-arg-multi.c b/glcpp/tests/019-define-func-1-arg-multi.c new file mode 100644 index 0000000000..c4e62b2550 --- /dev/null +++ b/glcpp/tests/019-define-func-1-arg-multi.c @@ -0,0 +1,2 @@ +#define foo(x) (x) +foo(this is more than one word) diff --git a/glcpp/tests/019-define-func-1-arg-multi.c.expected b/glcpp/tests/019-define-func-1-arg-multi.c.expected new file mode 100644 index 0000000000..1e89b8cfd0 --- /dev/null +++ b/glcpp/tests/019-define-func-1-arg-multi.c.expected @@ -0,0 +1,2 @@ + +(this is more than one word) diff --git a/glcpp/tests/020-define-func-2-arg-multi.c b/glcpp/tests/020-define-func-2-arg-multi.c new file mode 100644 index 0000000000..3049ad1546 --- /dev/null +++ b/glcpp/tests/020-define-func-2-arg-multi.c @@ -0,0 +1,2 @@ +#define foo(x,y) x,two fish,red fish,y +foo(one fish, blue fish) diff --git a/glcpp/tests/020-define-func-2-arg-multi.c.expected b/glcpp/tests/020-define-func-2-arg-multi.c.expected new file mode 100644 index 0000000000..19f59f5ecb --- /dev/null +++ b/glcpp/tests/020-define-func-2-arg-multi.c.expected @@ -0,0 +1,2 @@ + +one fish,two fish,red fish,blue fish diff --git a/glcpp/tests/021-define-func-compose.c b/glcpp/tests/021-define-func-compose.c new file mode 100644 index 0000000000..21ddd0e65f --- /dev/null +++ b/glcpp/tests/021-define-func-compose.c @@ -0,0 +1,3 @@ +#define bar(x) (1+(x)) +#define foo(y) (2*(y)) +foo(bar(3)) diff --git a/glcpp/tests/021-define-func-compose.c.expected b/glcpp/tests/021-define-func-compose.c.expected new file mode 100644 index 0000000000..87f51f0bac --- /dev/null +++ b/glcpp/tests/021-define-func-compose.c.expected @@ -0,0 +1,3 @@ + + +(2*((1+(3)))) diff --git a/glcpp/tests/022-define-func-arg-with-parens.c b/glcpp/tests/022-define-func-arg-with-parens.c new file mode 100644 index 0000000000..c20d73a4a2 --- /dev/null +++ b/glcpp/tests/022-define-func-arg-with-parens.c @@ -0,0 +1,2 @@ +#define foo(x) (x) +foo(argument(including parens)for the win) diff --git a/glcpp/tests/022-define-func-arg-with-parens.c.expected b/glcpp/tests/022-define-func-arg-with-parens.c.expected new file mode 100644 index 0000000000..1dfc6698bb --- /dev/null +++ b/glcpp/tests/022-define-func-arg-with-parens.c.expected @@ -0,0 +1,2 @@ + +(argument(including parens)for the win) diff --git a/glcpp/tests/023-define-extra-whitespace.c b/glcpp/tests/023-define-extra-whitespace.c new file mode 100644 index 0000000000..7ebfed6516 --- /dev/null +++ b/glcpp/tests/023-define-extra-whitespace.c @@ -0,0 +1,8 @@ +#define noargs() 1 +# define onearg(foo) foo + # define twoargs( x , y ) x y + # define threeargs( a , b , c ) a b c +noargs ( ) +onearg ( 2 ) +twoargs ( 3 , 4 ) +threeargs ( 5 , 6 , 7 ) diff --git a/glcpp/tests/023-define-extra-whitespace.c.expected b/glcpp/tests/023-define-extra-whitespace.c.expected new file mode 100644 index 0000000000..9c58275d0f --- /dev/null +++ b/glcpp/tests/023-define-extra-whitespace.c.expected @@ -0,0 +1,8 @@ + + + + +1 +2 +3 4 +5 6 7 diff --git a/glcpp/tests/024-define-chain-to-self-recursion.c b/glcpp/tests/024-define-chain-to-self-recursion.c new file mode 100644 index 0000000000..e788adce30 --- /dev/null +++ b/glcpp/tests/024-define-chain-to-self-recursion.c @@ -0,0 +1,3 @@ +#define foo foo +#define bar foo +bar diff --git a/glcpp/tests/024-define-chain-to-self-recursion.c.expected b/glcpp/tests/024-define-chain-to-self-recursion.c.expected new file mode 100644 index 0000000000..15600af546 --- /dev/null +++ b/glcpp/tests/024-define-chain-to-self-recursion.c.expected @@ -0,0 +1,3 @@ + + +foo diff --git a/glcpp/tests/025-func-macro-as-non-macro.c b/glcpp/tests/025-func-macro-as-non-macro.c new file mode 100644 index 0000000000..b433671d1b --- /dev/null +++ b/glcpp/tests/025-func-macro-as-non-macro.c @@ -0,0 +1,2 @@ +#define foo(bar) bar +foo bar diff --git a/glcpp/tests/025-func-macro-as-non-macro.c.expected b/glcpp/tests/025-func-macro-as-non-macro.c.expected new file mode 100644 index 0000000000..4a59f0520e --- /dev/null +++ b/glcpp/tests/025-func-macro-as-non-macro.c.expected @@ -0,0 +1,2 @@ + +foo bar diff --git a/glcpp/tests/026-define-func-extra-newlines.c b/glcpp/tests/026-define-func-extra-newlines.c new file mode 100644 index 0000000000..0d83740530 --- /dev/null +++ b/glcpp/tests/026-define-func-extra-newlines.c @@ -0,0 +1,6 @@ +#define foo(a) bar + +foo +( +1 +) diff --git a/glcpp/tests/026-define-func-extra-newlines.c.expected b/glcpp/tests/026-define-func-extra-newlines.c.expected new file mode 100644 index 0000000000..5e3c70f2cc --- /dev/null +++ b/glcpp/tests/026-define-func-extra-newlines.c.expected @@ -0,0 +1,3 @@ + + +bar diff --git a/glcpp/tests/027-define-chain-obj-to-func.c b/glcpp/tests/027-define-chain-obj-to-func.c new file mode 100644 index 0000000000..5ccb52caba --- /dev/null +++ b/glcpp/tests/027-define-chain-obj-to-func.c @@ -0,0 +1,3 @@ +#define failure() success +#define foo failure() +foo diff --git a/glcpp/tests/027-define-chain-obj-to-func.c.expected b/glcpp/tests/027-define-chain-obj-to-func.c.expected new file mode 100644 index 0000000000..94c15f9505 --- /dev/null +++ b/glcpp/tests/027-define-chain-obj-to-func.c.expected @@ -0,0 +1,3 @@ + + +success diff --git a/glcpp/tests/028-define-chain-obj-to-non-func.c b/glcpp/tests/028-define-chain-obj-to-non-func.c new file mode 100644 index 0000000000..44962a7187 --- /dev/null +++ b/glcpp/tests/028-define-chain-obj-to-non-func.c @@ -0,0 +1,3 @@ +#define success() failure +#define foo success +foo diff --git a/glcpp/tests/028-define-chain-obj-to-non-func.c.expected b/glcpp/tests/028-define-chain-obj-to-non-func.c.expected new file mode 100644 index 0000000000..94c15f9505 --- /dev/null +++ b/glcpp/tests/028-define-chain-obj-to-non-func.c.expected @@ -0,0 +1,3 @@ + + +success diff --git a/glcpp/tests/029-define-chain-obj-to-func-with-args.c b/glcpp/tests/029-define-chain-obj-to-func-with-args.c new file mode 100644 index 0000000000..261f7d28fc --- /dev/null +++ b/glcpp/tests/029-define-chain-obj-to-func-with-args.c @@ -0,0 +1,3 @@ +#define bar(failure) failure +#define foo bar(success) +foo diff --git a/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected b/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected new file mode 100644 index 0000000000..94c15f9505 --- /dev/null +++ b/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected @@ -0,0 +1,3 @@ + + +success diff --git a/glcpp/tests/030-define-chain-obj-to-func-compose.c b/glcpp/tests/030-define-chain-obj-to-func-compose.c new file mode 100644 index 0000000000..e56fbefd62 --- /dev/null +++ b/glcpp/tests/030-define-chain-obj-to-func-compose.c @@ -0,0 +1,4 @@ +#define baz(failure) failure +#define bar(failure) failure +#define foo bar(baz(success)) +foo diff --git a/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected b/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected new file mode 100644 index 0000000000..bed826e783 --- /dev/null +++ b/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected @@ -0,0 +1,4 @@ + + + +success diff --git a/glcpp/tests/031-define-chain-func-to-func-compose.c b/glcpp/tests/031-define-chain-func-to-func-compose.c new file mode 100644 index 0000000000..3f4c8744df --- /dev/null +++ b/glcpp/tests/031-define-chain-func-to-func-compose.c @@ -0,0 +1,4 @@ +#define baz(failure) failure +#define bar(failure) failure +#define foo() bar(baz(success)) +foo() diff --git a/glcpp/tests/031-define-chain-func-to-func-compose.c.expected b/glcpp/tests/031-define-chain-func-to-func-compose.c.expected new file mode 100644 index 0000000000..bed826e783 --- /dev/null +++ b/glcpp/tests/031-define-chain-func-to-func-compose.c.expected @@ -0,0 +1,4 @@ + + + +success diff --git a/glcpp/tests/032-define-func-self-recurse.c b/glcpp/tests/032-define-func-self-recurse.c new file mode 100644 index 0000000000..b3ac70f499 --- /dev/null +++ b/glcpp/tests/032-define-func-self-recurse.c @@ -0,0 +1,2 @@ +#define foo(a) foo(2*(a)) +foo(3) diff --git a/glcpp/tests/032-define-func-self-recurse.c.expected b/glcpp/tests/032-define-func-self-recurse.c.expected new file mode 100644 index 0000000000..983f941740 --- /dev/null +++ b/glcpp/tests/032-define-func-self-recurse.c.expected @@ -0,0 +1,2 @@ + +foo(2*(3)) diff --git a/glcpp/tests/033-define-func-self-compose.c b/glcpp/tests/033-define-func-self-compose.c new file mode 100644 index 0000000000..f65e48286c --- /dev/null +++ b/glcpp/tests/033-define-func-self-compose.c @@ -0,0 +1,2 @@ +#define foo(a) foo(2*(a)) +foo(foo(3)) diff --git a/glcpp/tests/033-define-func-self-compose.c.expected b/glcpp/tests/033-define-func-self-compose.c.expected new file mode 100644 index 0000000000..0818362364 --- /dev/null +++ b/glcpp/tests/033-define-func-self-compose.c.expected @@ -0,0 +1,2 @@ + +foo(2*(foo(2*(3)))) diff --git a/glcpp/tests/034-define-func-self-compose-non-func.c b/glcpp/tests/034-define-func-self-compose-non-func.c new file mode 100644 index 0000000000..209a5f7e07 --- /dev/null +++ b/glcpp/tests/034-define-func-self-compose-non-func.c @@ -0,0 +1,2 @@ +#define foo(bar) bar +foo(foo) diff --git a/glcpp/tests/034-define-func-self-compose-non-func.c.expected b/glcpp/tests/034-define-func-self-compose-non-func.c.expected new file mode 100644 index 0000000000..3f808fe665 --- /dev/null +++ b/glcpp/tests/034-define-func-self-compose-non-func.c.expected @@ -0,0 +1,2 @@ + +foo diff --git a/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c b/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c new file mode 100644 index 0000000000..c307fbe830 --- /dev/null +++ b/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c @@ -0,0 +1,2 @@ +#define foo(bar) bar +foo(1+foo) diff --git a/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected b/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected new file mode 100644 index 0000000000..09dfdd64e9 --- /dev/null +++ b/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected @@ -0,0 +1,2 @@ + +1+foo diff --git a/glcpp/tests/036-define-func-non-macro-multi-token-argument.c b/glcpp/tests/036-define-func-non-macro-multi-token-argument.c new file mode 100644 index 0000000000..b21ff33673 --- /dev/null +++ b/glcpp/tests/036-define-func-non-macro-multi-token-argument.c @@ -0,0 +1,3 @@ +#define bar success +#define foo(x) x +foo(more bar) diff --git a/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected b/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected new file mode 100644 index 0000000000..580ed9599c --- /dev/null +++ b/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected @@ -0,0 +1,3 @@ + + +more success diff --git a/glcpp/tests/037-finalize-unexpanded-macro.c b/glcpp/tests/037-finalize-unexpanded-macro.c new file mode 100644 index 0000000000..b3a2f37f1b --- /dev/null +++ b/glcpp/tests/037-finalize-unexpanded-macro.c @@ -0,0 +1,3 @@ +#define expand(x) expand(x once) +#define foo(x) x +foo(expand(just)) diff --git a/glcpp/tests/037-finalize-unexpanded-macro.c.expected b/glcpp/tests/037-finalize-unexpanded-macro.c.expected new file mode 100644 index 0000000000..e804d7e4f9 --- /dev/null +++ b/glcpp/tests/037-finalize-unexpanded-macro.c.expected @@ -0,0 +1,3 @@ + + +expand(just once) diff --git a/glcpp/tests/038-func-arg-with-commas.c b/glcpp/tests/038-func-arg-with-commas.c new file mode 100644 index 0000000000..1407c7d6e3 --- /dev/null +++ b/glcpp/tests/038-func-arg-with-commas.c @@ -0,0 +1,2 @@ +#define foo(x) success +foo(argument (with,embedded , commas) -- tricky) diff --git a/glcpp/tests/038-func-arg-with-commas.c.expected b/glcpp/tests/038-func-arg-with-commas.c.expected new file mode 100644 index 0000000000..6544adb3a2 --- /dev/null +++ b/glcpp/tests/038-func-arg-with-commas.c.expected @@ -0,0 +1,2 @@ + +success diff --git a/glcpp/tests/039-func-arg-obj-macro-with-comma.c b/glcpp/tests/039-func-arg-obj-macro-with-comma.c new file mode 100644 index 0000000000..0f7fe632b5 --- /dev/null +++ b/glcpp/tests/039-func-arg-obj-macro-with-comma.c @@ -0,0 +1,3 @@ +#define foo(a) (a) +#define bar two,words +foo(bar) diff --git a/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected b/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected new file mode 100644 index 0000000000..8a15397a03 --- /dev/null +++ b/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected @@ -0,0 +1,3 @@ + + +(two,words) diff --git a/glcpp/tests/040-token-pasting.c b/glcpp/tests/040-token-pasting.c new file mode 100644 index 0000000000..caab3ba736 --- /dev/null +++ b/glcpp/tests/040-token-pasting.c @@ -0,0 +1,2 @@ +#define paste(a,b) a ## b +paste(one , token) diff --git a/glcpp/tests/040-token-pasting.c.expected b/glcpp/tests/040-token-pasting.c.expected new file mode 100644 index 0000000000..48e836ec3f --- /dev/null +++ b/glcpp/tests/040-token-pasting.c.expected @@ -0,0 +1,2 @@ + +onetoken diff --git a/glcpp/tests/041-if-0.c b/glcpp/tests/041-if-0.c new file mode 100644 index 0000000000..2cab677d3e --- /dev/null +++ b/glcpp/tests/041-if-0.c @@ -0,0 +1,5 @@ +success_1 +#if 0 +failure +#endif +success_2 diff --git a/glcpp/tests/041-if-0.c.expected b/glcpp/tests/041-if-0.c.expected new file mode 100644 index 0000000000..8b506b32d5 --- /dev/null +++ b/glcpp/tests/041-if-0.c.expected @@ -0,0 +1,5 @@ +success_1 + + + +success_2 diff --git a/glcpp/tests/042-if-1.c b/glcpp/tests/042-if-1.c new file mode 100644 index 0000000000..874a25cf41 --- /dev/null +++ b/glcpp/tests/042-if-1.c @@ -0,0 +1,5 @@ +success_1 +#if 1 +success_2 +#endif +success_3 diff --git a/glcpp/tests/042-if-1.c.expected b/glcpp/tests/042-if-1.c.expected new file mode 100644 index 0000000000..a6ae9465a9 --- /dev/null +++ b/glcpp/tests/042-if-1.c.expected @@ -0,0 +1,5 @@ +success_1 + +success_2 + +success_3 diff --git a/glcpp/tests/043-if-0-else.c b/glcpp/tests/043-if-0-else.c new file mode 100644 index 0000000000..323351f9db --- /dev/null +++ b/glcpp/tests/043-if-0-else.c @@ -0,0 +1,7 @@ +success_1 +#if 0 +failure +#else +success_2 +#endif +success_3 diff --git a/glcpp/tests/043-if-0-else.c.expected b/glcpp/tests/043-if-0-else.c.expected new file mode 100644 index 0000000000..3d7e6be96c --- /dev/null +++ b/glcpp/tests/043-if-0-else.c.expected @@ -0,0 +1,7 @@ +success_1 + + + +success_2 + +success_3 diff --git a/glcpp/tests/044-if-1-else.c b/glcpp/tests/044-if-1-else.c new file mode 100644 index 0000000000..28dfc25c6f --- /dev/null +++ b/glcpp/tests/044-if-1-else.c @@ -0,0 +1,7 @@ +success_1 +#if 1 +success_2 +#else +failure +#endif +success_3 diff --git a/glcpp/tests/044-if-1-else.c.expected b/glcpp/tests/044-if-1-else.c.expected new file mode 100644 index 0000000000..4a31e1cfa9 --- /dev/null +++ b/glcpp/tests/044-if-1-else.c.expected @@ -0,0 +1,7 @@ +success_1 + +success_2 + + + +success_3 diff --git a/glcpp/tests/045-if-0-elif.c b/glcpp/tests/045-if-0-elif.c new file mode 100644 index 0000000000..e50f686d46 --- /dev/null +++ b/glcpp/tests/045-if-0-elif.c @@ -0,0 +1,11 @@ +success_1 +#if 0 +failure_1 +#elif 0 +failure_2 +#elif 1 +success_3 +#elif 1 +failure_3 +#endif +success_4 diff --git a/glcpp/tests/045-if-0-elif.c.expected b/glcpp/tests/045-if-0-elif.c.expected new file mode 100644 index 0000000000..a9bb1588e4 --- /dev/null +++ b/glcpp/tests/045-if-0-elif.c.expected @@ -0,0 +1,11 @@ +success_1 + + + + + +success_3 + + + +success_4 diff --git a/glcpp/tests/046-if-1-elsif.c b/glcpp/tests/046-if-1-elsif.c new file mode 100644 index 0000000000..130515a01e --- /dev/null +++ b/glcpp/tests/046-if-1-elsif.c @@ -0,0 +1,11 @@ +success_1 +#if 1 +success_2 +#elif 0 +failure_1 +#elif 1 +failure_2 +#elif 0 +failure_3 +#endif +success_3 diff --git a/glcpp/tests/046-if-1-elsif.c.expected b/glcpp/tests/046-if-1-elsif.c.expected new file mode 100644 index 0000000000..a4995713ca --- /dev/null +++ b/glcpp/tests/046-if-1-elsif.c.expected @@ -0,0 +1,11 @@ +success_1 + +success_2 + + + + + + + +success_3 diff --git a/glcpp/tests/047-if-elif-else.c b/glcpp/tests/047-if-elif-else.c new file mode 100644 index 0000000000..e8f0838a9e --- /dev/null +++ b/glcpp/tests/047-if-elif-else.c @@ -0,0 +1,11 @@ +success_1 +#if 0 +failure_1 +#elif 0 +failure_2 +#elif 0 +failure_3 +#else +success_2 +#endif +success_3 diff --git a/glcpp/tests/047-if-elif-else.c.expected b/glcpp/tests/047-if-elif-else.c.expected new file mode 100644 index 0000000000..54d3086119 --- /dev/null +++ b/glcpp/tests/047-if-elif-else.c.expected @@ -0,0 +1,11 @@ +success_1 + + + + + + + +success_2 + +success_3 diff --git a/glcpp/tests/048-if-nested.c b/glcpp/tests/048-if-nested.c new file mode 100644 index 0000000000..fc4679c3be --- /dev/null +++ b/glcpp/tests/048-if-nested.c @@ -0,0 +1,11 @@ +success_1 +#if 0 +failure_1 +#if 1 +failure_2 +#else +failure_3 +#endif +failure_4 +#endif +success_2 diff --git a/glcpp/tests/048-if-nested.c.expected b/glcpp/tests/048-if-nested.c.expected new file mode 100644 index 0000000000..8beb9c32c3 --- /dev/null +++ b/glcpp/tests/048-if-nested.c.expected @@ -0,0 +1,11 @@ +success_1 + + + + + + + + + +success_2 diff --git a/glcpp/tests/049-if-expression-precedence.c b/glcpp/tests/049-if-expression-precedence.c new file mode 100644 index 0000000000..833ea03882 --- /dev/null +++ b/glcpp/tests/049-if-expression-precedence.c @@ -0,0 +1,5 @@ +#if 1 + 2 * 3 + - (25 % 17 - + 1) +failure with operator precedence +#else +success +#endif diff --git a/glcpp/tests/049-if-expression-precedence.c.expected b/glcpp/tests/049-if-expression-precedence.c.expected new file mode 100644 index 0000000000..729bdd15f8 --- /dev/null +++ b/glcpp/tests/049-if-expression-precedence.c.expected @@ -0,0 +1,5 @@ + + + +success + diff --git a/glcpp/tests/050-if-defined.c b/glcpp/tests/050-if-defined.c new file mode 100644 index 0000000000..34f0f95140 --- /dev/null +++ b/glcpp/tests/050-if-defined.c @@ -0,0 +1,17 @@ +#if defined foo +failure_1 +#else +success_1 +#endif +#define foo +#if defined foo +success_2 +#else +failure_2 +#endif +#undef foo +#if defined foo +failure_3 +#else +success_3 +#endif diff --git a/glcpp/tests/050-if-defined.c.expected b/glcpp/tests/050-if-defined.c.expected new file mode 100644 index 0000000000..737eb8d940 --- /dev/null +++ b/glcpp/tests/050-if-defined.c.expected @@ -0,0 +1,17 @@ + + + +success_1 + + + +success_2 + + + + + + + +success_3 + diff --git a/glcpp/tests/051-if-relational.c b/glcpp/tests/051-if-relational.c new file mode 100644 index 0000000000..c3db488e0d --- /dev/null +++ b/glcpp/tests/051-if-relational.c @@ -0,0 +1,35 @@ +#if 3 < 2 +failure_1 +#else +success_1 +#endif + +#if 3 >= 2 +success_2 +#else +failure_2 +#endif + +#if 2 + 3 <= 5 +success_3 +#else +failure_3 +#endif + +#if 3 - 2 == 1 +success_3 +#else +failure_3 +#endif + +#if 1 > 3 +failure_4 +#else +success_4 +#endif + +#if 1 != 5 +success_5 +#else +failure_5 +#endif diff --git a/glcpp/tests/051-if-relational.c.expected b/glcpp/tests/051-if-relational.c.expected new file mode 100644 index 0000000000..652fefdd43 --- /dev/null +++ b/glcpp/tests/051-if-relational.c.expected @@ -0,0 +1,35 @@ + + + +success_1 + + + +success_2 + + + + + +success_3 + + + + + +success_3 + + + + + + + +success_4 + + + +success_5 + + + diff --git a/glcpp/tests/052-if-bitwise.c b/glcpp/tests/052-if-bitwise.c new file mode 100644 index 0000000000..2d8e45eb61 --- /dev/null +++ b/glcpp/tests/052-if-bitwise.c @@ -0,0 +1,20 @@ +#if (0xaaaaaaaa | 0x55555555) != 4294967295 +failure_1 +#else +success_1 +#endif +#if (0x12345678 ^ 0xfdecba98) == 4023971040 +success_2 +#else +failure_2 +#endif +#if (~ 0xdeadbeef) != -3735928560 +failure_3 +#else +success_3 +#endif +#if (0667 & 0733) == 403 +success_4 +#else +failure_4 +#endif diff --git a/glcpp/tests/052-if-bitwise.c.expected b/glcpp/tests/052-if-bitwise.c.expected new file mode 100644 index 0000000000..44e52b206e --- /dev/null +++ b/glcpp/tests/052-if-bitwise.c.expected @@ -0,0 +1,20 @@ + + + +success_1 + + +success_2 + + + + + + +success_3 + + +success_4 + + + diff --git a/glcpp/tests/053-if-divide-and-shift.c b/glcpp/tests/053-if-divide-and-shift.c new file mode 100644 index 0000000000..d24c54a88d --- /dev/null +++ b/glcpp/tests/053-if-divide-and-shift.c @@ -0,0 +1,15 @@ +#if (15 / 2) != 7 +failure_1 +#else +success_1 +#endif +#if (1 << 12) == 4096 +success_2 +#else +failure_2 +#endif +#if (31762 >> 8) != 124 +failure_3 +#else +success_3 +#endif diff --git a/glcpp/tests/053-if-divide-and-shift.c.expected b/glcpp/tests/053-if-divide-and-shift.c.expected new file mode 100644 index 0000000000..7e78e0454e --- /dev/null +++ b/glcpp/tests/053-if-divide-and-shift.c.expected @@ -0,0 +1,15 @@ + + + +success_1 + + +success_2 + + + + + + +success_3 + diff --git a/glcpp/tests/054-if-with-macros.c b/glcpp/tests/054-if-with-macros.c new file mode 100644 index 0000000000..3da79a0d96 --- /dev/null +++ b/glcpp/tests/054-if-with-macros.c @@ -0,0 +1,34 @@ +#define one 1 +#define two 2 +#define three 3 +#define five 5 +#if five < two +failure_1 +#else +success_1 +#endif +#if three >= two +success_2 +#else +failure_2 +#endif +#if two + three <= five +success_3 +#else +failure_3 +#endif +#if five - two == three +success_4 +#else +failure_4 +#endif +#if one > three +failure_5 +#else +success_5 +#endif +#if one != five +success_6 +#else +failure_6 +#endif diff --git a/glcpp/tests/054-if-with-macros.c.expected b/glcpp/tests/054-if-with-macros.c.expected new file mode 100644 index 0000000000..70f737c90a --- /dev/null +++ b/glcpp/tests/054-if-with-macros.c.expected @@ -0,0 +1,34 @@ + + + + + + + +success_1 + + +success_2 + + + + +success_3 + + + + +success_4 + + + + + + +success_5 + + +success_6 + + + diff --git a/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c b/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c new file mode 100644 index 0000000000..00f2c2346d --- /dev/null +++ b/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c @@ -0,0 +1,3 @@ +#define failure() success +#define foo failure +foo() diff --git a/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected b/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected new file mode 100644 index 0000000000..94c15f9505 --- /dev/null +++ b/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected @@ -0,0 +1,3 @@ + + +success diff --git a/glcpp/tests/056-macro-argument-with-comma.c b/glcpp/tests/056-macro-argument-with-comma.c new file mode 100644 index 0000000000..58701d1f25 --- /dev/null +++ b/glcpp/tests/056-macro-argument-with-comma.c @@ -0,0 +1,4 @@ +#define bar with,embedded,commas +#define function(x) success +#define foo function +foo(bar) diff --git a/glcpp/tests/056-macro-argument-with-comma.c.expected b/glcpp/tests/056-macro-argument-with-comma.c.expected new file mode 100644 index 0000000000..bed826e783 --- /dev/null +++ b/glcpp/tests/056-macro-argument-with-comma.c.expected @@ -0,0 +1,4 @@ + + + +success diff --git a/glcpp/tests/057-empty-arguments.c b/glcpp/tests/057-empty-arguments.c new file mode 100644 index 0000000000..6140232865 --- /dev/null +++ b/glcpp/tests/057-empty-arguments.c @@ -0,0 +1,6 @@ +#define zero() success +zero() +#define one(x) success +one() +#define two(x,y) success +two(,) diff --git a/glcpp/tests/057-empty-arguments.c.expected b/glcpp/tests/057-empty-arguments.c.expected new file mode 100644 index 0000000000..7d97e15e29 --- /dev/null +++ b/glcpp/tests/057-empty-arguments.c.expected @@ -0,0 +1,6 @@ + +success + +success + +success diff --git a/glcpp/tests/058-token-pasting-empty-arguments.c b/glcpp/tests/058-token-pasting-empty-arguments.c new file mode 100644 index 0000000000..8ac260c76b --- /dev/null +++ b/glcpp/tests/058-token-pasting-empty-arguments.c @@ -0,0 +1,5 @@ +#define paste(x,y) x ## y +paste(a,b) +paste(a,) +paste(,b) +paste(,) diff --git a/glcpp/tests/058-token-pasting-empty-arguments.c.expected b/glcpp/tests/058-token-pasting-empty-arguments.c.expected new file mode 100644 index 0000000000..e0967a1b95 --- /dev/null +++ b/glcpp/tests/058-token-pasting-empty-arguments.c.expected @@ -0,0 +1,5 @@ + +ab +a +b + diff --git a/glcpp/tests/059-token-pasting-integer.c b/glcpp/tests/059-token-pasting-integer.c new file mode 100644 index 0000000000..37b895a423 --- /dev/null +++ b/glcpp/tests/059-token-pasting-integer.c @@ -0,0 +1,4 @@ +#define paste(x,y) x ## y +paste(1,2) +paste(1,000) +paste(identifier,2) diff --git a/glcpp/tests/059-token-pasting-integer.c.expected b/glcpp/tests/059-token-pasting-integer.c.expected new file mode 100644 index 0000000000..f1288aa7cb --- /dev/null +++ b/glcpp/tests/059-token-pasting-integer.c.expected @@ -0,0 +1,4 @@ + +12 +1000 +identifier2 diff --git a/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c b/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c new file mode 100644 index 0000000000..ed80ea879c --- /dev/null +++ b/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c @@ -0,0 +1,3 @@ +#define double(a) a*2 +#define foo double( +foo 5) diff --git a/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected b/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected new file mode 100644 index 0000000000..3e5501aa6e --- /dev/null +++ b/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected @@ -0,0 +1,3 @@ + + +5*2 diff --git a/glcpp/tests/061-define-chain-obj-to-func-multi.c b/glcpp/tests/061-define-chain-obj-to-func-multi.c new file mode 100644 index 0000000000..6dbfd1f62d --- /dev/null +++ b/glcpp/tests/061-define-chain-obj-to-func-multi.c @@ -0,0 +1,5 @@ +#define foo(x) success +#define bar foo +#define baz bar +#define joe baz +joe (failure) diff --git a/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected b/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected new file mode 100644 index 0000000000..15eb64b97f --- /dev/null +++ b/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected @@ -0,0 +1,5 @@ + + + + +success diff --git a/glcpp/tests/062-if-0-skips-garbage.c b/glcpp/tests/062-if-0-skips-garbage.c new file mode 100644 index 0000000000..d9e439bb89 --- /dev/null +++ b/glcpp/tests/062-if-0-skips-garbage.c @@ -0,0 +1,5 @@ +#define foo(a,b) +#if 0 +foo(bar) +foo( +#endif diff --git a/glcpp/tests/062-if-0-skips-garbage.c.expected b/glcpp/tests/062-if-0-skips-garbage.c.expected new file mode 100644 index 0000000000..3f2ff2d6cc --- /dev/null +++ b/glcpp/tests/062-if-0-skips-garbage.c.expected @@ -0,0 +1,5 @@ + + + + + diff --git a/glcpp/tests/063-comments.c b/glcpp/tests/063-comments.c new file mode 100644 index 0000000000..e641d2f0f9 --- /dev/null +++ b/glcpp/tests/063-comments.c @@ -0,0 +1,20 @@ +/* this is a comment */ +// so is this +// */ +f = g/**//h; +/*//*/l(); +m = n//**/o ++ p; +/* this +comment spans +multiple lines and +contains *** stars +and slashes / *** / +and other stuff. +****/ +more code here +/* Test that /* nested + comments */ +are not treated like comments. +/*/ this is a comment */ +/*/*/ diff --git a/glcpp/tests/063-comments.c.expected b/glcpp/tests/063-comments.c.expected new file mode 100644 index 0000000000..4998d76cc2 --- /dev/null +++ b/glcpp/tests/063-comments.c.expected @@ -0,0 +1,13 @@ + + + +f = g /h; + l(); +m = n ++ p; + +more code here + +are not treated like comments. + + diff --git a/glcpp/tests/071-punctuator.c b/glcpp/tests/071-punctuator.c new file mode 100644 index 0000000000..959d682598 --- /dev/null +++ b/glcpp/tests/071-punctuator.c @@ -0,0 +1 @@ +a = b diff --git a/glcpp/tests/071-punctuator.c.expected b/glcpp/tests/071-punctuator.c.expected new file mode 100644 index 0000000000..959d682598 --- /dev/null +++ b/glcpp/tests/071-punctuator.c.expected @@ -0,0 +1 @@ +a = b diff --git a/glcpp/tests/072-token-pasting-same-line.c b/glcpp/tests/072-token-pasting-same-line.c new file mode 100644 index 0000000000..e421e9d5e2 --- /dev/null +++ b/glcpp/tests/072-token-pasting-same-line.c @@ -0,0 +1,2 @@ +#define paste(x) success_ ## x +paste(1) paste(2) paste(3) diff --git a/glcpp/tests/072-token-pasting-same-line.c.expected b/glcpp/tests/072-token-pasting-same-line.c.expected new file mode 100644 index 0000000000..7b80af7e46 --- /dev/null +++ b/glcpp/tests/072-token-pasting-same-line.c.expected @@ -0,0 +1,2 @@ + +success_1 success_2 success_3 diff --git a/glcpp/tests/099-c99-example.c b/glcpp/tests/099-c99-example.c new file mode 100644 index 0000000000..d1976b1f26 --- /dev/null +++ b/glcpp/tests/099-c99-example.c @@ -0,0 +1,17 @@ +#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 +f(y+1) + f(f(z)) % t(t(g)(0) + t)(1); +g(x +(3,4)-w) | h 5) & m + (f)^m(m); +p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,)}; diff --git a/glcpp/tests/099-c99-example.c.expected b/glcpp/tests/099-c99-example.c.expected new file mode 100644 index 0000000000..352bbff48f --- /dev/null +++ b/glcpp/tests/099-c99-example.c.expected @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +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); +int i[] = { 1, 23, 4, 5, }; diff --git a/glcpp/tests/glcpp-test b/glcpp/tests/glcpp-test new file mode 100755 index 0000000000..396f6e175e --- /dev/null +++ b/glcpp/tests/glcpp-test @@ -0,0 +1,7 @@ +#!/bin/sh + +for test in *.c; do + echo "Testing $test" + ../glcpp < $test > $test.out + diff -u $test.expected $test.out +done |