OSDN Git Service

* gfortran.h (struct gfc_symbol): Add equiv_built.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.fortran-torture / execute / intrinsic_present.f90
1 ! Program to test the PRESENT intrinsic
2 program intrinsic_present
3    implicit none
4    integer a
5    integer, pointer :: b
6    integer, dimension(10) :: c
7    integer, pointer, dimension(:) :: d
8    
9    if (testvar()) call abort ()
10    if (.not. testvar(a)) call abort ()
11    if (testptr()) call abort ()
12    if (.not. testptr(b)) call abort ()
13    if (testarray()) call abort ()
14    if (.not. testarray(c)) call abort ()
15    if (testparray()) call abort ()
16    if (.not. testparray(d)) call abort ()
17    
18 contains
19 logical function testvar (p)
20    integer, optional :: p
21    testvar = present(p)
22 end function
23
24 logical function testptr (p)
25    integer, pointer, optional :: p
26    testptr = present(p)
27 end function
28
29 logical function testarray (p)
30    integer, dimension (10), optional :: p
31    testarray = present(p)
32 end function
33
34 logical function testparray (p)
35    integer, pointer, dimension(:), optional :: p
36    testparray = present(p)
37 end function
38
39 end program
40