[flang] Add notify-type and notify-wait-stmt (#76594)

Add `notify-type` to `iso_fortran_env` module. Add `notify-wait-stmt` to
the parser and add checks for constraints on the statement, `C1177` and
`C1178`, from the Fortran 2023 standard. Add three semantics tests for
`notify-wait-stmt`.
This commit is contained in:
Katherine Rasmussen
2024-01-02 10:40:47 -08:00
committed by GitHub
parent 0d19a8983c
commit a2d7af757b
18 changed files with 368 additions and 70 deletions

View File

@@ -1150,6 +1150,11 @@ public:
void Unparse(const FailImageStmt &) { // R1163
Word("FAIL IMAGE");
}
void Unparse(const NotifyWaitStmt &x) { // F2023: R1166
Word("NOTIFY WAIT ("), Walk(std::get<Scalar<Variable>>(x.t));
Walk(", ", std::get<std::list<EventWaitSpec>>(x.t), ", ");
Put(')');
}
void Unparse(const SyncAllStmt &x) { // R1164
Word("SYNC ALL ("), Walk(x.v, ", "), Put(')');
}
@@ -1169,7 +1174,7 @@ public:
Word("EVENT POST ("), Walk(std::get<EventVariable>(x.t));
Walk(", ", std::get<std::list<StatOrErrmsg>>(x.t), ", "), Put(')');
}
void Before(const EventWaitStmt::EventWaitSpec &x) { // R1173, R1174
void Before(const EventWaitSpec &x) { // R1173, R1174
common::visit(common::visitors{
[&](const ScalarIntExpr &) { Word("UNTIL_COUNT="); },
[](const StatOrErrmsg &) {},
@@ -1178,7 +1183,7 @@ public:
}
void Unparse(const EventWaitStmt &x) { // R1170
Word("EVENT WAIT ("), Walk(std::get<EventVariable>(x.t));
Walk(", ", std::get<std::list<EventWaitStmt::EventWaitSpec>>(x.t), ", ");
Walk(", ", std::get<std::list<EventWaitSpec>>(x.t), ", ");
Put(')');
}
void Unparse(const FormTeamStmt &x) { // R1175, R1177