From 9fdca0bf6ae95e0dc4d8e93f22256e7c90f28f6e Mon Sep 17 00:00:00 2001 From: Efimov Vasily Date: Mon, 30 Oct 2017 19:12:58 +0300 Subject: test: add example of incorrect expansion of concatenation (##) in macro Signed-off-by: Efimov Vasily --- test/testcpp.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/testcpp.py b/test/testcpp.py index 2582c03..51508c4 100644 --- a/test/testcpp.py +++ b/test/testcpp.py @@ -45,4 +45,27 @@ class CPPTests(TestCase): else: self.assertMultiLineEqual(out, expected) + def test_concatenation(self): + self.__test_preprocessing("""\ +#define a(x) x##_ +#define b(x) _##x +#define c(x) _##x##_ +#define d(x,y) _##x##y##_ + +a(i) +b(j) +c(k) +d(q,s)""" + , """\ + + + + + +i_ +_j +_k_ +_qs_""" + ) + main() -- cgit v1.2.1