[flang-commits] [flang] [flang][OpenMP] Lowering support for declare variant. (PR #206988)
via flang-commits
flang-commits at lists.llvm.org
Thu Jul 2 02:56:04 PDT 2026
SunilKuravinakop wrote:
> > subroutine base(n)
> > integer, intent(n) :: n
> > !$omp declare variant(base:vsub) match(user={condition(n > 20)})
> > contains
> > subroutine vsub
> > end subroutine
> > end subroutine
> > subroutine driver(size)
> > use variants
> > integer, intent(in) :: size
> > call base(size) ! base/vsub chosen depends on `size` at run time
> > end subroutine
>
> There is already a test `base7` in `declare-variant-call.f90` that tests call site with an argument. Please also note that declare variant does not support dynamic condition at the moment. Something like above will generate following error: `error: Run-time USER condition in the MATCH clause is not yet implemented`
There is no test case for checking the Run-time user condition "error". Please add one.
https://github.com/llvm/llvm-project/pull/206988
More information about the flang-commits
mailing list