Merge aosp-toolchain/gcc/gcc-4_9 changes.
[official-gcc.git] / gcc-4_9 / gcc / testsuite / gfortran.dg / entry_3.f90
blob36595ee31e10e8ffe10a54fa2110acdeaa55fa67
1 ! { dg-do run }
2 ! Test assumed shape arrays in procedures with multiple entry points.
3 ! Arguments that aren't present in all entry points must be treated like
4 ! optional arguments.
5 module entry_4
6 contains
7 subroutine foo(a)
8 integer, dimension(:) :: a
9 integer, dimension(:) :: b
10 a = (/1, 2/)
11 return
12 entry bar(b)
13 b = (/3, 4/)
14 end subroutine
15 end module
17 program entry_4_prog
18 use entry_4
19 integer :: a(2)
20 a = 0
21 call foo(a)
22 if (any (a .ne. (/1, 2/))) call abort
23 call bar(a)
24 if (any (a .ne. (/3, 4/))) call abort
25 end program