std::optional<StructureConstructor> GetScalarValue() const;
StructureConstructor At(const ConstantSubscripts &) const;
+ bool operator==(const Constant &) const;
Constant Reshape(ConstantSubscripts &&) const;
std::size_t CopyFrom(const Constant &source, std::size_t count,
ConstantSubscripts &resultSubscripts, const std::vector<int> *dimOrder);
return {result().derivedTypeSpec(), values_.at(SubscriptsToOffset(index))};
}
+bool Constant<SomeDerived>::operator==(
+ const Constant<SomeDerived> &that) const {
+ return result().derivedTypeSpec() == that.result().derivedTypeSpec() &&
+ shape() == that.shape() && values_ == that.values_;
+}
+
auto Constant<SomeDerived>::Reshape(ConstantSubscripts &&dims) const
-> Constant {
return {result().derivedTypeSpec(), Base::Reshape(dims), std::move(dims)};
integer :: i
end type
+type emptyType1
+end type emptyType1
+
+type emptyType2
+end type emptyType2
+
print *, [42, 42]
! CHECK: fir.address_of(@_QQro.2xi4.0)
print *, [otherType(42)]
! CHECK: fir.address_of(@_QQro.1x_QFTothertype.14)
+ print *, [emptyType1()]
+ print *, [emptyType2()]
end
! CHECK: fir.global internal @_QQro.1x_QFTsometype.10 constant : !fir.array<1x!fir.type<_QFTsometype{i:i32}>> {