1 ! Program to test functions returning arrays
5 integer, dimension (6, 5) :: a
8 ! These first two shouldn't require a temporary.
11 if (a(1,1) .ne. 42) call abort
12 if (a(6,5) .ne. 43) call abort
15 a(1:6:2, 2:5) = test2()
16 if (a(1,2) .ne. 42) call abort
17 if (a(5,5) .ne. 43) call abort
20 ! This requires a temporary
22 if (a(1,1) .ne. 41) call abort
23 if (a(6,5) .ne. 42) call abort
30 integer, dimension (1:x, 1:y) :: test
36 function test2 () result (foo)
38 integer, dimension (3, 4) :: foo