2 ! Test the fix for PR57522, in which the associate name had a
3 ! 'span' of an INTEGER rather than that of 'mytype'.
5 ! Contributed by A Briolat <alan.briolat@gmail.com>
9 integer :: a = 1, b = 2
11 type(mytype) :: t(4), u(2,2)
16 ! Test 'a' is OK on lhs and/or rhs of assignments
18 if (any (c .ne. [-1,0,1,2])) call abort
20 if (any (a .ne. [1,2,3,4])) call abort
22 if (any (a .ne. t%b)) call abort
23 ! Test 'a' is OK as an actual argument
25 if (any (c .ne. t%b + 10)) call abort
27 ! Make sure that the fix works for multi-dimensional arrays...
29 if (any (a .ne. reshape ([1,1,1,1],[2,2]))) call abort
32 associate (a => t(2:3)%b)
33 if (any (a .ne. [5,6])) call abort
36 function foo(arg) result(res)
37 integer :: arg(4), res(4)