155682Smarkm! { dg-do compile }
2233294Sstas! { dg-options "-fdump-tree-original" }
355682Smarkm! Tests the fix for PR 30872, in which the array element references bo(1,1) etc.
455682Smarkm! would be wrong for rank > 1.
5233294Sstas!
655682Smarkm! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
755682Smarkm!
855682Smarkm INTEGER, PARAMETER, DIMENSION(2,3) :: bo= &
9233294Sstas                    RESHAPE((/-1,1,-2,2,-3,3/),(/2,3/))
1055682Smarkm REAL(kind=8), DIMENSION(  &
1155682Smarkm          bo(1,1):bo(2,1), &
12233294Sstas          bo(1,2):bo(2,2), &
1355682Smarkm          bo(1,3):bo(2,3)) :: out_val
1455682Smarkm out_val=0.0
1555682SmarkmEND
16233294Sstas! Scan for the 105 in the declaration real8 out_val[105];
1755682Smarkm! { dg-final { scan-tree-dump-times "105" 1 "original" } }
1855682Smarkm! { dg-final { cleanup-tree-dump "original" } }
1955682Smarkm
20233294Sstas