diff options
author | Peter Klausler <pklausler@nvidia.com> | 2023-05-17 07:57:38 -0700 |
---|---|---|
committer | Peter Klausler <pklausler@nvidia.com> | 2023-05-18 11:41:07 -0700 |
commit | 60b673023f54e899c727e32414fd89b646a147e4 (patch) | |
tree | f05e606c852a10fc53b32ee9802fba1dc4d50ea1 /flang/test/Parser | |
parent | d624aba28bb5d3ad6e4078d536a94d26f1548144 (diff) | |
download | llvm-60b673023f54e899c727e32414fd89b646a147e4.zip llvm-60b673023f54e899c727e32414fd89b646a147e4.tar.gz llvm-60b673023f54e899c727e32414fd89b646a147e4.tar.bz2 |
[flang] Better error recovery for missing THEN in IF construct
Presented with "IF (...)" with no following tokens in the statement,
diagnose a missing "THEN" instead of complaining about all of the
possible action statement initial tokens that could have been there
for a non-construct IF statement.
Fixes https://github.com/llvm/llvm-project/issues/62299.
Differential Revision: https://reviews.llvm.org/D150783
Diffstat (limited to 'flang/test/Parser')
-rw-r--r-- | flang/test/Parser/missing-then.f90 | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/flang/test/Parser/missing-then.f90 b/flang/test/Parser/missing-then.f90 new file mode 100644 index 0000000..ccaee3e --- /dev/null +++ b/flang/test/Parser/missing-then.f90 @@ -0,0 +1,8 @@ +! RUN: not %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s +!CHECK: expected 'THEN' +!CHECK-NOT: expected 'PAUSE' +if (.TRUE.) +!CHECK: expected 'THEN' +else if (.FALSE.) +end if +end |