[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Evaluate / folding25.f90
blobdd01880d47d784df4a5c208c7a8bd442bed60e0d
1 ! RUN: %python %S/test_folding.py %s %flang_fc1
2 ! Tests folding of UNPACK (valid cases)
3 module m
4 integer, parameter :: vector(*) = [1, 2, 3, 4]
5 integer, parameter :: field(2,3) = reshape([(-j,j=1,6)], shape(field))
6 logical, parameter :: mask(*,*) = reshape([.false., .true., .true., .false., .false., .true.], shape(field))
7 logical, parameter :: test_unpack_1 = all(unpack(vector, mask, 0) == reshape([0,1,2,0,0,3], shape(mask)))
8 logical, parameter :: test_unpack_2 = all(unpack(vector, mask, field) == reshape([-1,1,2,-4,-5,3], shape(mask)))
9 end module