1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
3 ! UNPACK() intrinsic function error tests
5 integer, dimension(2) :: vector
= [343, 512]
6 logical, dimension(2, 2) :: mask
= &
7 reshape([.true
., .false
., .true
., .false
.], [2, 2])
8 integer, dimension(2, 2) :: field
= reshape([1, 2, 3, 4, 5, 6], [2, 2])
9 integer, dimension(2, 1) :: bad_field
= reshape([1, 2], [2, 1])
10 integer :: scalar_field
11 integer, dimension(2, 2) :: result
12 result
= unpack(vector
, mask
, field
)
13 !ERROR: Dimension 2 of 'mask=' argument has extent 2, but 'field=' argument has extent 1
14 result
= unpack(vector
, mask
, bad_field
)
15 result
= unpack(vector
, mask
, scalar_field
)