diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-08 16:18:49 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-08 16:18:49 +0000 |
commit | 71fd77c9b4b3398097c48d6c1d3be7296d670f89 (patch) | |
tree | ca77b69e8b4f032f1066c6a31847233f9db7f8e5 /gcc/testsuite/gfortran.dg/proc_ptr_3.f90 | |
parent | 313793ac30b7208dfb273ab1823bed6b0c20deb4 (diff) | |
download | gcc-71fd77c9b4b3398097c48d6c1d3be7296d670f89.tar.gz |
2008-07-08 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r137620
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@137632 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg/proc_ptr_3.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/proc_ptr_3.f90 | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_3.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_3.f90 new file mode 100644 index 00000000000..34d4f1625fb --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_3.f90 @@ -0,0 +1,45 @@ +! { dg-do run } +! +! PROCEDURE POINTERS without the PROCEDURE statement +! +! Contributed by Janus Weil <janus@gcc.gnu.org> + +real function e1(x) + real :: x + print *,'e1!',x + e1 = x * 3.0 +end function + +subroutine e2(a,b) + real, intent(inout) :: a + real, intent(in) :: b + print *,'e2!',a,b + a = a + b +end subroutine + +program proc_ptr_3 + +real, external, pointer :: fp + +pointer :: sp +interface + subroutine sp(a,b) + real, intent(inout) :: a + real, intent(in) :: b + end subroutine sp +end interface + +external :: e1,e2 +real :: c = 1.2 + +fp => e1 + +if (abs(fp(2.5)-7.5)>0.01) call abort() + +sp => e2 + +call sp(c,3.4) + +if (abs(c-4.6)>0.01) call abort() + +end |