| 1 |
! Test lowering of intrinsic procedure to HLFIR with assumed types |
| 2 |
! arguments. These are a bit special because semantics do not represent |
| 3 |
! assumed types actual arguments with an evaluate::Expr like for usual |
| 4 |
! arguments. |
| 5 |
! RUN: bbc -emit-hlfir -o - %s | FileCheck %s |
| 6 |
|
| 7 |
subroutine assumed_type_to_intrinsic(a) |
| 8 |
type(*) :: a(:) |
| 9 |
if (is_contiguous(a)) call something() |
| 10 |
end subroutine |
| 11 |
! CHECK-LABEL: func.func @_QPassumed_type_to_intrinsic( |
| 12 |
! CHECK: %[[VAL_1:.*]]:2 = hlfir.declare {{.*}}a" |
| 13 |
! CHECK: %[[VAL_2:.*]] = fir.convert %[[VAL_1]]#1 : (!fir.box<!fir.array<?xnone>>) -> !fir.box<none> |
| 14 |
! CHECK: fir.call @_FortranAIsContiguous(%[[VAL_2]]) {{.*}}: (!fir.box<none>) -> i1 |
| 15 |
|
| 16 |
subroutine assumed_type_optional_to_intrinsic(a) |
| 17 |
type(*), optional :: a(:) |
| 18 |
if (present(a)) call something() |
| 19 |
end subroutine |
| 20 |
! CHECK-LABEL: func.func @_QPassumed_type_optional_to_intrinsic( |
| 21 |
! CHECK: %[[VAL_1:.*]]:2 = hlfir.declare {{.*}}a" |
| 22 |
! CHECK: fir.is_present %[[VAL_1]]#1 : (!fir.box<!fir.array<?xnone>>) -> i1 |