xref: /llvm-project/flang/test/Lower/HLFIR/designators-parameter-array-slice.f90 (revision d0829fbdeda0a2faa8cf684e1396e579691bdfa2)
1! Test non-contiguous slice of parameter array.
2! RUN: bbc -emit-hlfir -o - %s | FileCheck %s
3subroutine test2(i)
4  integer, parameter :: a(*,*) = reshape( [ 1,2,3,4 ], [ 2,2 ])
5  integer :: x(2)
6  x = a(i,:)
7end subroutine test2
8! Check that the result type of the designate operation
9! is a box (as opposed to !fir.ref<!fir.array<>>) that is able
10! to represent non-contiguous array section:
11! CHECK: hlfir.designate {{.*}} shape {{.*}} : (!fir.ref<!fir.array<2x2xi32>>, i64, index, index, index, !fir.shape<1>) -> !fir.box<!fir.array<2xi32>>
12