aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2009-04-07 09:24:37 +0200
committerJanus Weil <janus@gcc.gnu.org>2009-04-07 09:24:37 +0200
commit3afadac3ca557d83ad115178a631aeb60659b0c5 (patch)
treeb6a3794c0ef4b9169b679011d0325bd1a347a4f6 /gcc/testsuite
parent445099463a83367ddabb201e9e29e5a741cce034 (diff)
downloadgcc-3afadac3ca557d83ad115178a631aeb60659b0c5.zip
gcc-3afadac3ca557d83ad115178a631aeb60659b0c5.tar.gz
gcc-3afadac3ca557d83ad115178a631aeb60659b0c5.tar.bz2
re PR other/38920 (dw2 exceptions don't work.)
2009-04-07 Janus Weil <janus@gcc.gnu.org> PR fortran/38920 * expr.c (gfc_check_pointer_assign): Enable interface check for procedure pointers. * gfortran.h: Add copy_formal_args_intr. * interface.c (gfc_compare_interfaces): Call gfc_compare_intr_interfaces if second argument is an intrinsic. (compare_intr_interfaces): Correctly set attr.function, attr.subroutine and ts. (compare_parameter): Call gfc_compare_interfaces also for intrinsics. * resolve.c (resolve_specific_f0,resolve_specific_s0): Don't resolve intrinsic interfaces here. Must happen earlier. (resolve_symbol): Resolution of intrinsic interfaces moved here from resolve_specific_..., and formal args are now copied from intrinsic interfaces. * symbol.c (copy_formal_args_intr): New function to copy the formal arguments from an intinsic procedure. 2009-04-07 Janus Weil <janus@gcc.gnu.org> PR fortran/38920 * gfortran.dg/proc_decl_1.f90: Modified. * gfortran.dg/proc_ptr_11.f90: Extended. * gfortran.dg/proc_ptr_13.f90: Modified. From-SVN: r145651
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gfortran.dg/proc_decl_1.f9019
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_11.f9031
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_13.f903
4 files changed, 45 insertions, 15 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b4864a2..41488df 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-07 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/38920
+ * gfortran.dg/proc_decl_1.f90: Modified.
+ * gfortran.dg/proc_ptr_11.f90: Extended.
+ * gfortran.dg/proc_ptr_13.f90: Modified.
+
2009-04-06 Jason Merrill <jason@redhat.com>
PR c++/35146
diff --git a/gcc/testsuite/gfortran.dg/proc_decl_1.f90 b/gcc/testsuite/gfortran.dg/proc_decl_1.f90
index 392ce76..1df8b27 100644
--- a/gcc/testsuite/gfortran.dg/proc_decl_1.f90
+++ b/gcc/testsuite/gfortran.dg/proc_decl_1.f90
@@ -19,8 +19,15 @@ module m
public:: h
procedure(),public:: h ! { dg-error "was already specified" }
-end module m
+contains
+ subroutine abc
+ procedure() :: abc2
+ entry abc2(x) ! { dg-error "PROCEDURE attribute conflicts with ENTRY attribute" }
+ real x
+ end subroutine
+
+end module m
program prog
@@ -68,13 +75,3 @@ contains
end subroutine foo
end program
-
-
-subroutine abc
-
- procedure() :: abc2
-
-entry abc2(x) ! { dg-error "PROCEDURE attribute conflicts with ENTRY attribute" }
- real x
-
-end subroutine
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_11.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_11.f90
index 69bf140..5c39f99 100644
--- a/gcc/testsuite/gfortran.dg/proc_ptr_11.f90
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_11.f90
@@ -16,13 +16,35 @@ program bsp
procedure( up ) , pointer :: pptr
procedure(isign), pointer :: q
- ! TODO. See PR 38290.
- !pptr => add ! { "Interfaces don't match" }
+ procedure(iabs),pointer :: p1
+ procedure(f), pointer :: p2
+
+ pointer :: p3
+ interface
+ function p3(x)
+ real(8) :: p3,x
+ end function p3
+ end interface
+
+ pptr => add ! { dg-error "Interfaces don't match" }
q => add
print *, pptr() ! { dg-error "is not a function" }
+ p1 => iabs
+ p2 => iabs
+ p1 => f
+ p2 => f
+ p2 => p1
+ p1 => p2
+
+ p1 => abs ! { dg-error "Interfaces don't match" }
+ p2 => abs ! { dg-error "Interfaces don't match" }
+
+ p3 => dsin
+ p3 => sin ! { dg-error "Interfaces don't match" }
+
contains
function add( a, b )
@@ -31,4 +53,9 @@ program bsp
add = a + b
end function add
+ integer function f(x)
+ integer :: x
+ f = 317 + x
+ end function
+
end program bsp
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_13.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_13.f90
index a7f391f..a0e69af 100644
--- a/gcc/testsuite/gfortran.dg/proc_ptr_13.f90
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_13.f90
@@ -22,8 +22,7 @@ END MODULE myfortran_binding
use myfortran_binding
-external foo
-error_handler => foo
+error_handler => error_stop
end
! { dg-final { cleanup-modules "myfortran_binding" } }