diff options
| author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2015-01-18 22:00:10 +0100 |
|---|---|---|
| committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2015-01-18 22:00:10 +0100 |
| commit | fb6331e0fa34338f4ff8a54d5efabc8a6b46f119 (patch) | |
| tree | 66947402d0c57ddc2c728343ecd4dfb0dc188fd5 /tests | |
| parent | a6149c6dbb417eee7cdd26d87d1fbd2598339c2f (diff) | |
| download | tinycc-fb6331e0fa34338f4ff8a54d5efabc8a6b46f119.tar.gz tinycc-fb6331e0fa34338f4ff8a54d5efabc8a6b46f119.tar.bz2 | |
Fix macro expansion of empty args.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/tests2/71_macro_empty_arg.c | 9 | ||||
| -rw-r--r-- | tests/tests2/71_macro_empty_arg.expect | 1 | ||||
| -rw-r--r-- | tests/tests2/Makefile | 4 |
3 files changed, 13 insertions, 1 deletions
diff --git a/tests/tests2/71_macro_empty_arg.c b/tests/tests2/71_macro_empty_arg.c new file mode 100644 index 0000000..f0d3511 --- /dev/null +++ b/tests/tests2/71_macro_empty_arg.c @@ -0,0 +1,9 @@ +#include <stdio.h> + +#define T(a,b,c) a b c + +int main(void) +{ + printf("%d", T(1,+,2) T(+,,) T(,2,*) T(,7,) T(,,)); + return 0; +} diff --git a/tests/tests2/71_macro_empty_arg.expect b/tests/tests2/71_macro_empty_arg.expect new file mode 100644 index 0000000..98d9bcb --- /dev/null +++ b/tests/tests2/71_macro_empty_arg.expect @@ -0,0 +1 @@ +17 diff --git a/tests/tests2/Makefile b/tests/tests2/Makefile index 8e11f2c..ec636ab 100644 --- a/tests/tests2/Makefile +++ b/tests/tests2/Makefile @@ -89,7 +89,9 @@ TESTS = \ 67_macro_concat.test \ 68_macro_param_list_err_1.test \ 69_macro_param_list_err_2.test \ - 70_floating_point_literals.test + 70_floating_point_literals.test \ + 71_macro_empty_arg.test \ + # 34_array_assignment.test -- array assignment is not in C standard |
