[flang] Lowering and implementation for extends_type_of
authorValentin Clement <clementval@gmail.com>
Wed, 11 Jan 2023 08:31:33 +0000 (09:31 +0100)
committerValentin Clement <clementval@gmail.com>
Wed, 11 Jan 2023 08:32:22 +0000 (09:32 +0100)
commit87bd946138483068ab30ff8a19d4ec344de42f57
treea1583e071ba9610ea40a8715cca36fa3d34dabfa
parent4bb1751140b99ce4a8bb7f88c1b631c535e52f1d
[flang] Lowering and implementation for extends_type_of

Add implementation and loweirng for the extends_type_of
intrinsic.

The standard mentions this: otherwise if the dynamic type of A or MOLD is
extensible, the result is true if and only if the dynamic type of A is an
extension type of the dynamic type of MOLD. Which could be interpreted that
`extends_type_of(a, a)` could be false since a type is not an extension of
itself. Gfortran result for this is `true` so the same behavior is applied
here as well.

Depends on D141364

Reviewed By: jeanPerier, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D141376
flang/include/flang/Optimizer/Builder/Runtime/Derived.h
flang/include/flang/Runtime/derived-api.h
flang/lib/Lower/IntrinsicCall.cpp
flang/lib/Optimizer/Builder/Runtime/Derived.cpp
flang/runtime/derived-api.cpp
flang/test/Lower/Intrinsics/extends_type_of.f90 [new file with mode: 0644]