[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / unpack.f90
blob71bd21c7fb008292ea968800d08b6be5de00e9f5
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 ! UNPACK() intrinsic function error tests
4 program test_unpack
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)
16 end program