Skip to content

Commit 208326f

Browse files
committed
add test
1 parent 74a5a63 commit 208326f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,6 +2388,17 @@ static void ifDefinedHashHash2()
23882388
ASSERT_EQUALS("\n0", preprocess(code, &outputList));
23892389
}
23902390

2391+
static void ifDefinedHashHash3()
2392+
{
2393+
const char code[] = "#define ENABLED(x) (defined(x ## _ENABLED) && (x ## _ENABLED))\n"
2394+
"#define FOO_ENABLED 1\n"
2395+
"#if ENABLED(FOO)\n"
2396+
"int x;\n"
2397+
"#endif\n";
2398+
simplecpp::OutputList outputList;
2399+
ASSERT_EQUALS("\n\n\nint x ;", preprocess(code, &outputList));
2400+
}
2401+
23912402
static void ifLogical()
23922403
{
23932404
const char code[] = "#if defined(A) || defined(B)\n"
@@ -4701,6 +4712,7 @@ static void runTests(int argc, char **argv, Input input)
47014712
TEST_CASE(ifDefinedInvalid2);
47024713
TEST_CASE(ifDefinedHashHash);
47034714
TEST_CASE(ifDefinedHashHash2);
4715+
TEST_CASE(ifDefinedHashHash3);
47044716
TEST_CASE(ifLogical);
47054717
TEST_CASE(ifSizeof);
47064718
TEST_CASE(elif);

0 commit comments

Comments
 (0)