return true;
} else if (!isElemental && actual.Rank() != x.type.Rank() &&
!x.type.attrs().test(
- characteristics::TypeAndShape::Attr::AssumedRank)) {
+ characteristics::TypeAndShape::Attr::AssumedRank) &&
+ !x.ignoreTKR.test(common::IgnoreTKR::Rank)) {
return false;
} else if (auto actualType{actual.GetType()}) {
- return x.type.type().IsTkCompatibleWith(*actualType);
+ return x.type.type().IsTkCompatibleWith(*actualType, x.ignoreTKR);
}
return false;
},
os << " (has unanalyzedPDTComponentInit)";
}
if (!x.ignoreTKR_.empty()) {
- os << ' ';
- x.ignoreTKR_.Dump(os, common::EnumToString);
+ x.ignoreTKR_.Dump(os << ' ', common::EnumToString);
}
return os;
}
--- /dev/null
+! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s
+program main
+ interface generic
+ subroutine sub1(j, k)
+ integer(1) j
+ integer k
+ !dir$ ignore_tkr(kr) k
+ end
+ subroutine sub2(j, k)
+ integer(2) j
+ integer k
+ !dir$ ignore_tkr(kr) k
+ end
+ subroutine sub4(j, k)
+ integer(4) j
+ integer k
+ !dir$ ignore_tkr(kr) k
+ end
+ end interface
+!CHECK: CALL sub1(1_1,int(1_1,kind=4))
+ call generic(1_1,1_1)
+!CHECK: CALL sub1(1_1,int(1_2,kind=4))
+ call generic(1_1,1_2)
+!CHECK: CALL sub1(1_1,[INTEGER(1)::1_1])
+ call generic(1_1,[1_1])
+!CHECK: CALL sub2(1_2,int(1_1,kind=4))
+ call generic(1_2,1_1)
+!CHECK: CALL sub2(1_2,int(1_2,kind=4))
+ call generic(1_2,1_2)
+!CHECK: CALL sub2(1_2,[INTEGER(1)::1_1])
+ call generic(1_2,[1_1])
+!CHECK: CALL sub4(1_4,int(1_1,kind=4))
+ call generic(1_4,1_1)
+!CHECK: CALL sub4(1_4,int(1_2,kind=4))
+ call generic(1_4,1_2)
+!CHECK: CALL sub4(1_4,[INTEGER(1)::1_1])
+ call generic(1_4,[1_1])
+end