diff options
author | Peter Klausler <35819229+klausler@users.noreply.github.com> | 2024-01-15 10:16:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-15 10:16:52 -0800 |
commit | 3d6c6855c1f0b8570f280adb9a3dbb1f950b9115 (patch) | |
tree | c66d5c3baad6433278bd7b9f16d99542a64a504f | |
parent | e06b5a2435f2e4d422dfcf099ba5e4b9b2573fa9 (diff) | |
download | llvm-3d6c6855c1f0b8570f280adb9a3dbb1f950b9115.zip llvm-3d6c6855c1f0b8570f280adb9a3dbb1f950b9115.tar.gz llvm-3d6c6855c1f0b8570f280adb9a3dbb1f950b9115.tar.bz2 |
[flang][runtime] Fix total MAXLOC/MINLOC over CHARACTER data (#76880)
The implementation of MAXLOC/MINLOC without DIM=1 is wrong for CHARACTER
data -- change it to use the character comparator rather than the
numeric comparator.
Fixes llvm-test-suite/Fortran/gfortran/regression/maxloc_string_1.f90.
-rw-r--r-- | flang/runtime/extrema.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/flang/runtime/extrema.cpp b/flang/runtime/extrema.cpp index edb5d5f..281d8c9 100644 --- a/flang/runtime/extrema.cpp +++ b/flang/runtime/extrema.cpp @@ -135,7 +135,7 @@ template <bool IS_MAX> struct CharacterMaxOrMinLocHelper { RT_API_ATTRS void operator()(const char *intrinsic, Descriptor &result, const Descriptor &x, int kind, const char *source, int line, const Descriptor *mask, bool back) const { - DoMaxOrMinLoc<TypeCategory::Character, KIND, IS_MAX, NumericCompare>( + DoMaxOrMinLoc<TypeCategory::Character, KIND, IS_MAX, CharacterCompare>( intrinsic, result, x, kind, source, line, mask, back); } }; |