xref: /llvm-project/flang/test/Evaluate/fold-ishftc.f90 (revision e3b6b9299c9691c7dcde0f80b8af679a50540979)
1! RUN: %python %S/test_folding.py %s %flang_fc1
2! Tests folding of ISHFTC
3module m
4  integer, parameter :: shift8s(*) = ishftc(257, shift = [(ict, ict = -8, 8)], size=8)
5  integer, parameter :: expect1(*) = 256 + [1, 2, 4, 8, 16, 32, 64, 128, &
6                                            1, 2, 4, 8, 16, 32, 64, 128, 1]
7  logical, parameter :: test_1 = all(shift8s == expect1)
8  integer, parameter :: sizes(*) = [(ishftc(257, ict, [(isz, isz = 1, 8)]), ict = -1, 1)]
9  integer, parameter :: expect2(*) = 256 + [[1, 2, 4, 8, 16, 32, 64, 128], &
10                                            [(1, j = 1, 8)], &
11                                            [1, (2, j = 2, 8)]]
12  logical, parameter :: test_2 = all(sizes == expect2)
13end module
14
15