Skip to content

Commit 175750e

Browse files
committed
add test
1 parent a6d3586 commit 175750e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,6 +1825,15 @@ static void ifexpr()
18251825
ASSERT_EQUALS("\n\n1", preprocess(code));
18261826
}
18271827

1828+
static void ifUndefFuncStyleMacro()
1829+
{
1830+
const char code[] = "#if A(<dir/file.h>)\n"
1831+
"#endif\n";
1832+
simplecpp::OutputList outputList;
1833+
ASSERT_EQUALS("", preprocess(code, &outputList));
1834+
ASSERT_EQUALS("file0,1,syntax_error,Undefined function-like macro in directive\n", toString(outputList));
1835+
}
1836+
18281837
static void location1()
18291838
{
18301839
const char *code;
@@ -3145,6 +3154,7 @@ int main(int argc, char **argv)
31453154
TEST_CASE(ifdiv0);
31463155
TEST_CASE(ifalt); // using "and", "or", etc
31473156
TEST_CASE(ifexpr);
3157+
TEST_CASE(ifUndefFuncStyleMacro);
31483158

31493159
TEST_CASE(location1);
31503160
TEST_CASE(location2);

0 commit comments

Comments
 (0)