Preprocessor: Added TODO testcase when using variadic macros

This commit is contained in:
Daniel Marjamäki 2010-03-24 19:24:53 +01:00
parent 9808a59cc1
commit bef1857221
1 changed files with 12 additions and 0 deletions

View File

@ -1292,6 +1292,18 @@ private:
ASSERT_EQUALS("\n\nprintf(\"hello: %d\",3);\n", OurPreprocessor::expandMacros(filedata));
}
{
const char filedata[] = "#define BC(b, c...) 0##b * 0##c\n"
"#define ABC(a, b...) a + BC(b)\n"
"\n"
"ABC(1);\n"
"ABC(2,3);\n"
"ABC(4,5,6);\n";
// When this TODO assertion works, #1475 is probably fixed
TODO_ASSERT_EQUALS("\n\n\n1 + 0 * 0\n2 + 03 * 0\n4 + 05 * 06\n", OurPreprocessor::expandMacros(filedata));
}
{
const char filedata[] = "#define A 4\n"
"#define B(a) a,A\n"