1 ! RUN: %python %S/test_folding.py %s %flang_fc1
2 ! Tests folding of IBITS exhaustively over POS/LEN ranges
5 integer, parameter :: res1(*) = [((ibits(not(0),pos
,len
),len
=0,31-pos
),pos
=0,31)]
6 integer, parameter :: expect1(*) = [((maskr(len
),len
=0,31-pos
),pos
=0,31)]
7 logical, parameter :: test1
= all(res1
== expect1
)
8 logical, parameter :: test2
= all([((ibits(0,pos
,len
),len
=0,31-pos
),pos
=0,31)] == 0)
9 integer, parameter :: mess
= z
'a5a55a5a'
10 integer, parameter :: res3(*) = [((ibits(mess
,pos
,len
),len
=0,31-pos
),pos
=0,31)]
11 integer, parameter :: expect3(*) = [((iand(shiftr(mess
,pos
),maskr(len
)),len
=0,31-pos
),pos
=0,31)]
12 logical, parameter :: test3
= all(res3
== expect3
)