[flang-commits] [flang] 78649a8 - [flang] Accept INDEX(..., BACK=array)
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Wed Jan 19 17:54:15 PST 2022
Author: Peter Klausler
Date: 2022-01-19T17:37:24-08:00
New Revision: 78649a8499a0177cced99dcd61afcb48809e9109
URL: https://github.com/llvm/llvm-project/commit/78649a8499a0177cced99dcd61afcb48809e9109
DIFF: https://github.com/llvm/llvm-project/commit/78649a8499a0177cced99dcd61afcb48809e9109.diff
LOG: [flang] Accept INDEX(..., BACK=array)
The intrinsic table entry for INDEX mistakenly required
the optional BACK= argument to be scalar, but it's an
elemental intrinsic that can accept a conforming array.
Differential Revision: https://reviews.llvm.org/D117700
Added:
Modified:
flang/lib/Evaluate/intrinsics.cpp
flang/test/Evaluate/folding05.f90
Removed:
################################################################################
diff --git a/flang/lib/Evaluate/intrinsics.cpp b/flang/lib/Evaluate/intrinsics.cpp
index 851871a8ef1e6..ae7e5e9bf7885 100644
--- a/flang/lib/Evaluate/intrinsics.cpp
+++ b/flang/lib/Evaluate/intrinsics.cpp
@@ -486,7 +486,7 @@ static const IntrinsicInterface genericIntrinsicFunction[]{
{"image_status", {{"image", SameInt}, OptionalTEAM}, DefaultInt},
{"index",
{{"string", SameChar}, {"substring", SameChar},
- {"back", AnyLogical, Rank::scalar, Optionality::optional},
+ {"back", AnyLogical, Rank::elemental, Optionality::optional},
DefaultingKIND},
KINDInt},
{"int", {{"a", AnyNumeric, Rank::elementalOrBOZ}, DefaultingKIND}, KINDInt},
diff --git a/flang/test/Evaluate/folding05.f90 b/flang/test/Evaluate/folding05.f90
index 4ace088ec551d..3be3904ccab51 100644
Binary files a/flang/test/Evaluate/folding05.f90 and b/flang/test/Evaluate/folding05.f90
diff er
More information about the flang-commits
mailing list