xref: /llvm-project/flang/test/Evaluate/folding16.f90 (revision 39ee23ed5ab3f411b6945a3acbbdf22cd8a0a6cb)
1! RUN: %python %S/test_folding.py %s %flang_fc1
2! Ensure that lower bounds are accounted for in intrinsic folding;
3! this is a regression test for a bug in which they were not
4module m
5  real, parameter :: a(-1:-1) = 1.
6  real, parameter :: b(-1:-1) = log(a)
7  integer, parameter :: c(-1:1) = [33, 22, 11]
8  integer, parameter :: d(1:3) = [33, 22, 11]
9  integer, parameter :: e(-2:0) = ([33, 22, 11])
10  logical, parameter :: test_1 = lbound((a),1)==1 .and. lbound(b,1)==-1 .and. &
11                               lbound(log(a),1)==1 .and. all(b==0)
12  logical, parameter :: test_2 = all(c .eq. d)
13  logical, parameter :: test_3 = all(c .eq. e)
14  logical, parameter :: test_4 = all(d .eq. e)
15end
16