forked from OSchip/llvm-project
[flang] Fix intrinsic table probing issue with DOUBLE COMPLEX
The probing table was only expecting REAL for kind code `KindCode::doublePrecision` that is also used for `DoublePrecisionComplex`. Add related tests. Original-commit: flang-compiler/f18@342ed7e769 Reviewed-on: https://github.com/flang-compiler/f18/pull/680
This commit is contained in:
parent
252e22ea97
commit
98af2162d0
|
@ -1206,10 +1206,9 @@ std::optional<SpecificCall> IntrinsicInterface::Match(
|
|||
DynamicType{*category, defaults.GetDefaultKind(TypeCategory::Real)};
|
||||
break;
|
||||
case KindCode::doublePrecision:
|
||||
CHECK(result.categorySet == RealType);
|
||||
CHECK(*category == TypeCategory::Real);
|
||||
resultType =
|
||||
DynamicType{TypeCategory::Real, defaults.doublePrecisionKind()};
|
||||
CHECK(result.categorySet == CategorySet{*category});
|
||||
CHECK(FloatingType.test(*category));
|
||||
resultType = DynamicType{*category, defaults.doublePrecisionKind()};
|
||||
break;
|
||||
case KindCode::defaultCharKind:
|
||||
CHECK(result.categorySet == CharType);
|
||||
|
|
|
@ -226,6 +226,16 @@ void TestIntrinsics() {
|
|||
amin1Call.DoCall(Real4::GetType());
|
||||
amin1WrongCall.DoCall();
|
||||
|
||||
TestCall{table, "conjg"}
|
||||
.Push(Const(Scalar<Complex4>{}))
|
||||
.DoCall(Complex4::GetType());
|
||||
TestCall{table, "conjg"}
|
||||
.Push(Const(Scalar<Complex8>{}))
|
||||
.DoCall(Complex8::GetType());
|
||||
TestCall{table, "dconjg"}.Push(Const(Scalar<Complex4>{})).DoCall();
|
||||
TestCall{table, "dconjg"}
|
||||
.Push(Const(Scalar<Complex8>{}))
|
||||
.DoCall(Complex8::GetType());
|
||||
// TODO: test other intrinsics
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue