forked from qt-creator/qt-creator
preprocessor: add an example of a macro that generates code
Change-Id: I902ebd73e039b8c3f44eca456be87809d1e1d3a4 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
#define DECLARE_CLASS(s) class s
|
||||||
|
DECLARE_CLASS(QString);
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# 1 "data/macro_expand_1.cpp"
|
||||||
|
#gen true
|
||||||
|
# 1 "data/macro_expand_1.cpp"
|
||||||
|
class
|
||||||
|
#gen false
|
||||||
|
# 2 "data/macro_expand_1.cpp"
|
||||||
|
QString;
|
||||||
@@ -677,6 +677,8 @@ void tst_Preprocessor::comparisons_data()
|
|||||||
<< "macro_pounder_fn.c" << "" << "";
|
<< "macro_pounder_fn.c" << "" << "";
|
||||||
QTest::newRow("macro_expand")
|
QTest::newRow("macro_expand")
|
||||||
<< "macro_expand.c" << "macro_expand.out.c" << "";
|
<< "macro_expand.c" << "macro_expand.out.c" << "";
|
||||||
|
QTest::newRow("macro_expand_1")
|
||||||
|
<< "macro_expand_1.cpp" << "macro_expand_1.out.cpp" << "";
|
||||||
QTest::newRow("macro-test")
|
QTest::newRow("macro-test")
|
||||||
<< "macro-test.cpp" << "macro-test.out.cpp" << "";
|
<< "macro-test.cpp" << "macro-test.out.cpp" << "";
|
||||||
QTest::newRow("empty-macro")
|
QTest::newRow("empty-macro")
|
||||||
|
|||||||
Reference in New Issue
Block a user