diff options
author | Efimov Vasily <real@ispras.ru> | 2017-10-30 18:06:44 +0300 |
---|---|---|
committer | Efimov Vasily <real@ispras.ru> | 2017-10-30 19:56:22 +0300 |
commit | 40bec356f44293671ce7af0c4f1742ad040cbe82 (patch) | |
tree | 5ae9ffb2acca9656b764fd185f8d89081989b05c | |
parent | 0f8746853a068373c3bdcd31d870b6af9123180b (diff) | |
download | ply-40bec356f44293671ce7af0c4f1742ad040cbe82.tar.gz |
test: add example that leads preprocessor to a dead loop
Signed-off-by: Efimov Vasily <real@ispras.ru>
-rw-r--r-- | test/testcpp.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/testcpp.py b/test/testcpp.py index 51508c4..dba536e 100644 --- a/test/testcpp.py +++ b/test/testcpp.py @@ -68,4 +68,19 @@ _k_ _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() |