diff options
| author | Thomas Preud'homme <robotux@celest.fr> | 2014-04-12 12:00:13 +0800 |
|---|---|---|
| committer | Thomas Preud'homme <robotux@celest.fr> | 2014-04-12 16:11:42 +0800 |
| commit | 6e56bb387db8af055ff6de71a23b270de55c3dc8 (patch) | |
| tree | c44b72ccaa7914b4e269cbca9a73e00d22eb59a6 /tests/tests2 | |
| parent | 9714d2e75f70f8fcca9fd7b596440a346e504742 (diff) | |
| download | tinycc-6e56bb387db8af055ff6de71a23b270de55c3dc8.tar.gz tinycc-6e56bb387db8af055ff6de71a23b270de55c3dc8.tar.bz2 | |
Fix preprocessor concat with empty arg
Diffstat (limited to 'tests/tests2')
| -rw-r--r-- | tests/tests2/67_macro_concat.c | 14 | ||||
| -rw-r--r-- | tests/tests2/67_macro_concat.expect | 2 | ||||
| -rw-r--r-- | tests/tests2/Makefile | 3 |
3 files changed, 18 insertions, 1 deletions
diff --git a/tests/tests2/67_macro_concat.c b/tests/tests2/67_macro_concat.c new file mode 100644 index 0000000..c580d3a --- /dev/null +++ b/tests/tests2/67_macro_concat.c @@ -0,0 +1,14 @@ +#include <stdio.h> + +#define P(A,B) A ## B ; bob +#define Q(A,B) A ## B+ + +int main(void) +{ + int bob, jim = 21; + bob = P(jim,) *= 2; + printf("jim: %d, bob: %d\n", jim, bob); + jim = 60 Q(+,)3; + printf("jim: %d\n", jim); + return 0; +} diff --git a/tests/tests2/67_macro_concat.expect b/tests/tests2/67_macro_concat.expect new file mode 100644 index 0000000..8386c2d --- /dev/null +++ b/tests/tests2/67_macro_concat.expect @@ -0,0 +1,2 @@ +jim: 21, bob: 42 +jim: 63 diff --git a/tests/tests2/Makefile b/tests/tests2/Makefile index 41adb2d..a7c8a2f 100644 --- a/tests/tests2/Makefile +++ b/tests/tests2/Makefile @@ -81,7 +81,8 @@ TESTS = \ 63_local_enumerator_redefinition.test \ 64_macro_nesting.test \ 65_macro_concat_start.test \ - 66_macro_concat_end.test + 66_macro_concat_end.test \ + 67_macro_concat.test # 30_hanoi.test -- seg fault in the code, gcc as well # 34_array_assignment.test -- array assignment is not in C standard |
