Commit e8712250 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

C++: Add a failing test for pp concat bug

Task-number: QTCREATORBUG-13219
Change-Id: I6278d7977f0ce560e793838c90cfbc867e1af025
Reviewed-by: default avatarNikolai Kosjar <>
parent b4112d78
......@@ -389,6 +389,7 @@ private slots:
void empty_trailing_lines();
void empty_trailing_lines_data();
void undef();
void concat();
// Remove all #... lines, and 'simplify' string, to allow easily comparing the result
......@@ -1868,6 +1869,32 @@ void tst_Preprocessor::undef()
void tst_Preprocessor::concat()
Environment env;
Preprocessor preprocess(0, &env);
QByteArray input =
"#define concat(x,y) x ## y\n"
"#define xconcat(x, y) concat(x, y)\n"
"#define FOO 42\n"
"int var = xconcat(0x, FOO);\n";
QByteArray prep ="<stdin>"), input);
const QByteArray output = _(
"# 1 \"<stdin>\"\n"
"int var =\n"
"# expansion begin 87,7 ~1\n"
"# expansion end\n"
"# 4 \"<stdin>\"\n"
" ;\n"
QCOMPARE(prep.constData(), output.constData());
void tst_Preprocessor::compare_input_output(bool keepComments)
QFETCH(QByteArray, input);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment