From 2521d7d6e420e07c39c3a3d3b9565407940f9091 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 27 Apr 2012 17:11:48 +0200 Subject: [PATCH] preprocessor: add (failing) test for concatenation Change-Id: I9d51798cb4d95141d30b0609d03cd1d199088f0a Reviewed-by: hjk --- tests/auto/cplusplus/preprocessor/data/poundpound.1.cpp | 7 +++++++ .../auto/cplusplus/preprocessor/data/poundpound.1.out.cpp | 8 ++++++++ tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 tests/auto/cplusplus/preprocessor/data/poundpound.1.cpp create mode 100644 tests/auto/cplusplus/preprocessor/data/poundpound.1.out.cpp diff --git a/tests/auto/cplusplus/preprocessor/data/poundpound.1.cpp b/tests/auto/cplusplus/preprocessor/data/poundpound.1.cpp new file mode 100644 index 00000000000..ab02ae6a666 --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/poundpound.1.cpp @@ -0,0 +1,7 @@ +struct QQ {}; + +#define NN(x) typedef QQ PP ## x; + +NN(CC) + +typedef PPCC RR; diff --git a/tests/auto/cplusplus/preprocessor/data/poundpound.1.out.cpp b/tests/auto/cplusplus/preprocessor/data/poundpound.1.out.cpp new file mode 100644 index 00000000000..40d92e888ac --- /dev/null +++ b/tests/auto/cplusplus/preprocessor/data/poundpound.1.out.cpp @@ -0,0 +1,8 @@ +# 1 "data/poundpound.1.cpp" +struct QQ {}; +#gen true +# 3 "data/poundpound.1.cpp" +typedef QQ PPCC; +#gen false +# 7 "data/poundpound.1.cpp" +typedef PPCC RR; diff --git a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp index fd97d143ac5..a883d5858be 100644 --- a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp +++ b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp @@ -683,6 +683,8 @@ void tst_Preprocessor::comparisons_data() << "empty-macro.cpp" << "empty-macro.out.cpp" << ""; QTest::newRow("empty-macro 2") << "empty-macro.2.cpp" << "empty-macro.2.out.cpp" << ""; + QTest::newRow("poundpound 1") + << "poundpound.1.cpp" << "poundpound.1.out.cpp" << ""; } void tst_Preprocessor::comparisons()