aboutsummaryrefslogtreecommitdiff
path: root/flang/test/Parser
diff options
context:
space:
mode:
authorPeter Klausler <pklausler@nvidia.com>2023-05-17 07:57:38 -0700
committerPeter Klausler <pklausler@nvidia.com>2023-05-18 11:41:07 -0700
commit60b673023f54e899c727e32414fd89b646a147e4 (patch)
treef05e606c852a10fc53b32ee9802fba1dc4d50ea1 /flang/test/Parser
parentd624aba28bb5d3ad6e4078d536a94d26f1548144 (diff)
downloadllvm-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.f908
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