[flang-commits] [flang] [flang] Add image_index to list of intrinsics and add tests (PR #79519)
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Thu Jan 25 15:30:18 PST 2024
================
@@ -1433,6 +1433,23 @@ static void CheckAssociated(evaluate::ActualArguments &arguments,
}
}
+// IMAGE_INDEX (F'2023 16.9.107)
+static void CheckImage_Index(evaluate::ActualArguments &arguments,
+ parser::ContextualMessages &messages) {
+ if (arguments[1] && arguments[0]) {
+ if (auto subArrShape{evaluate::GetShape(arguments[1]->UnwrapExpr())}) {
+ if (const auto *coarrayArgSymbol{UnwrapWholeSymbolOrComponentDataRef(
+ arguments[0]->UnwrapExpr())}) {
+ if (evaluate::ToInt64(*subArrShape->front()) !=
+ coarrayArgSymbol->Corank()) {
+ messages.Say(arguments[1]->sourceLocation(),
+ "The size of the 'sub=' argument for intrinsic 'image_index' must be equal to the corank of the 'coarray=' argument"_err_en_US);
----------------
klausler wrote:
Please include the offending values with the message.
https://github.com/llvm/llvm-project/pull/79519
More information about the flang-commits
mailing list