Skip to content

Commit 50d1aad

Browse files
committed
test.cpp: added test for #296
1 parent 316d4ee commit 50d1aad

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,18 @@ static void define13()
719719
"}", preprocess(code));
720720
}
721721

722+
static void define14() // #296
723+
{
724+
const char code[] = "#define bar(x) x % 2\n"
725+
"#define foo(x) printf(#x \"\\n\")\n"
726+
"\n"
727+
" foo(bar(3));\n";
728+
ASSERT_EQUALS("\n"
729+
"\n"
730+
"\n"
731+
"printf ( \"bar(3)\" \"\\n\" ) ;", preprocess(code));
732+
}
733+
722734

723735

724736
static void define_invalid_1()
@@ -3685,6 +3697,7 @@ static void runTests(int argc, char **argv, Input input)
36853697
TEST_CASE(define11);
36863698
TEST_CASE(define12);
36873699
TEST_CASE(define13);
3700+
TEST_CASE(define14); // #296
36883701
TEST_CASE(define_invalid_1);
36893702
TEST_CASE(define_invalid_2);
36903703
TEST_CASE(define_define_1);

0 commit comments

Comments
 (0)