2021-09-06 21:54:33 +08:00
|
|
|
! RUN: %python %S/test_folding.py %s %flang_fc1
|
2020-12-16 02:59:26 +08:00
|
|
|
! Ensure that lower bounds are accounted for in intrinsic folding;
|
|
|
|
! this is a regression test for a bug in which they were not
|
2021-01-27 00:20:57 +08:00
|
|
|
module m
|
|
|
|
real, parameter :: a(-1:-1) = 1.
|
|
|
|
real, parameter :: b(-1:-1) = log(a)
|
|
|
|
integer, parameter :: c(-1:1) = [33, 22, 11]
|
|
|
|
integer, parameter :: d(1:3) = [33, 22, 11]
|
|
|
|
integer, parameter :: e(-2:0) = ([33, 22, 11])
|
2022-04-21 00:53:09 +08:00
|
|
|
logical, parameter :: test_1 = lbound((a),1)==1 .and. lbound(b,1)==-1 .and. &
|
2021-02-03 06:15:50 +08:00
|
|
|
lbound(log(a),1)==1 .and. all(b==0)
|
2021-01-27 00:20:57 +08:00
|
|
|
logical, parameter :: test_2 = all(c .eq. d)
|
|
|
|
logical, parameter :: test_3 = all(c .eq. e)
|
|
|
|
logical, parameter :: test_4 = all(d .eq. e)
|
2020-12-16 02:59:26 +08:00
|
|
|
end
|