[flang] Fix handling of space between # and name in preprocessor stringification
authorPeter Klausler <pklausler@nvidia.com>
Wed, 29 Dec 2021 20:14:25 +0000 (12:14 -0800)
committerPeter Klausler <pklausler@nvidia.com>
Thu, 13 Jan 2022 00:02:17 +0000 (16:02 -0800)
commit0e811d3b66ff85c13629d80c483c5d706eb4d15f
treea4823c8a5076ea4760b6fdc9aa815995fdae9690
parentb9bc3c107c6cee93cd1a7004142f11741e0225bf
[flang] Fix handling of space between # and name in preprocessor stringification

When preprocessing "# ARG" in function-like macro expansion,
the preprocessor needs to pop the previously-pushed '#' token
from the end of the resulting token sequence after detecting the
argument name.  The code to do this was just wrong in a couple of
ways.

Differential Revision: https://reviews.llvm.org/D117148
flang/lib/Parser/preprocessor.cpp
flang/test/Preprocessing/pp045.F [new file with mode: 0644]
flang/test/Preprocessing/pp131.F90 [new file with mode: 0644]