Skip to content

Commit

Permalink
test: add example that leads preprocessor to a dead loop
Browse files Browse the repository at this point in the history
Signed-off-by: Efimov Vasily <[email protected]>
  • Loading branch information
laerreal committed Oct 30, 2017
1 parent 0f87468 commit 40bec35
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/testcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,19 @@ def test_concatenation(self):
_qs_"""
)

def test_deadloop_macro(self):
# If there is a word which equals to name of a parametrized macro, then
# attempt to expand such word as a macro manages the parser to fall
# into an infinite loop.

self.__test_preprocessing("""\
#define a(x) x
a;"""
, """\
a;"""
)

main()

0 comments on commit 40bec35

Please sign in to comment.