Skip to content

Commit 5cef3c1

Browse files
committed
test.cpp: added test for #296
1 parent ac5cbe3 commit 5cef3c1

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
@@ -691,6 +691,18 @@ static void define13()
691691
"}", preprocess(code));
692692
}
693693

694+
static void define14() // #296
695+
{
696+
const char code[] = "#define bar(x) x % 2\n"
697+
"#define foo(x) printf(#x \"\\n\")\n"
698+
"\n"
699+
" foo(bar(3));\n";
700+
ASSERT_EQUALS("\n"
701+
"\n"
702+
"\n"
703+
"printf ( \"bar(3)\" \"\\n\" ) ;", preprocess(code));
704+
}
705+
694706

695707

696708
static void define_invalid_1()
@@ -3655,6 +3667,7 @@ int main(int argc, char **argv)
36553667
TEST_CASE(define11);
36563668
TEST_CASE(define12);
36573669
TEST_CASE(define13);
3670+
TEST_CASE(define14); // #296
36583671
TEST_CASE(define_invalid_1);
36593672
TEST_CASE(define_invalid_2);
36603673
TEST_CASE(define_define_1);

0 commit comments

Comments
 (0)