Skip to content

Commit

Permalink
fixed danmar#387 - do not undefine source-level defines via -U
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Nov 22, 2024
1 parent 967ef7d commit 8327672
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2474,6 +2474,18 @@ static void userdef()
ASSERT_EQUALS("\n123", preprocess(code, dui));
}

static void userundef()
{
const char code[] =
"#define A\n"
"#ifdef A\n"
"123\n"
"#endif\n";
simplecpp::DUI dui;
dui.undefined.insert("A");
ASSERT_EQUALS("\n\n123", preprocess(code, dui));
}

static void utf8()
{
ASSERT_EQUALS("123", readfile("\xEF\xBB\xBF 123"));
Expand Down

0 comments on commit 8327672

Please sign in to comment.