diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2013-01-27 07:09:06 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2013-01-27 07:09:06 +0000 |
commit | aa271860870b642b35b39938fdb39ff30af70c43 (patch) | |
tree | fe0ca5f04c7acfc990df2467d358c30147ce59fc /gcc/testsuite | |
parent | 170c0f31d1e0080e8dba330d39fb37399df64b76 (diff) | |
download | gcc-aa271860870b642b35b39938fdb39ff30af70c43.zip gcc-aa271860870b642b35b39938fdb39ff30af70c43.tar.gz gcc-aa271860870b642b35b39938fdb39ff30af70c43.tar.bz2 |
[multiple changes]
2013-01-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/55789
PR fortran/56047
* gfortran.h : Add associate_var to symbol_attr.
* resolve.c (resolve_assoc_var): Set associate_var attribute.
If the target class_ok is set, set it for the associate
variable.
* check.c (allocatable_check): Associate variables should not
have the allocatable attribute even if their symbols do.
* class.c (gfc_build_class_symbol): Symbols with associate_var
set will always have a good class container.
2013-01-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/55789
* gfortran.dg/associate_14.f90: New test.
PR fortran/56047
* gfortran.dg/associate_13.f90: New test.
From-SVN: r195492
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/associate_13.f90 | 21 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/associate_14.f90 | 56 |
3 files changed, 85 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index db9f367..b2fbe88 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2013-01-27 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/55789 + * gfortran.dg/associate_14.f90: New test. + + PR fortran/56047 + * gfortran.dg/associate_13.f90: New test. + 2013-01-25 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/56098 diff --git a/gcc/testsuite/gfortran.dg/associate_13.f90 b/gcc/testsuite/gfortran.dg/associate_13.f90 new file mode 100644 index 0000000..7c64d3f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/associate_13.f90 @@ -0,0 +1,21 @@ +! { dg-do run } +! +! Tests the fix for PR56047. This is actually a development of +! the test case of comment #10. +! +! Reported by Juergen Reuter <juergen.reuter@desy.de> +! + implicit none + type :: process_variant_def_t + integer :: i + end type + type :: process_component_def_t + class(process_variant_def_t), allocatable :: variant_def + end type + type(process_component_def_t), dimension(1:2) :: initial + allocate (initial(1)%variant_def, source = process_variant_def_t (99)) + associate (template => initial(1)%variant_def) + template%i = 77 + end associate + if (initial(1)%variant_def%i .ne. 77) call abort +end diff --git a/gcc/testsuite/gfortran.dg/associate_14.f90 b/gcc/testsuite/gfortran.dg/associate_14.f90 new file mode 100644 index 0000000..765e365 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/associate_14.f90 @@ -0,0 +1,56 @@ +! { dg-do compile } +! Tests the fix for PR55984. +! +! Contributed by Sylwester Arabas <slayoo@staszic.waw.pl> +! +module bcd_m + type, abstract :: bcd_t + contains + procedure(bcd_fill_halos), deferred :: fill_halos + end type + abstract interface + subroutine bcd_fill_halos(this) + import :: bcd_t + class(bcd_t ) :: this + end subroutine + end interface +end module + +module solver_m + use bcd_m + type, abstract :: solver_t + integer :: n, hlo + class(bcd_t), pointer :: bcx, bcy + contains + procedure(solver_advop), deferred :: advop + end type + abstract interface + subroutine solver_advop(this) + import solver_t + class(solver_t) :: this + end subroutine + end interface + contains +end module + +module solver_mpdata_m + use solver_m + type :: mpdata_t + class(bcd_t), pointer :: bcx, bcy + contains + procedure :: advop => mpdata_advop + end type + contains + subroutine mpdata_advop(this) + class(mpdata_t) :: this + associate ( bcx => this%bcx, bcy => this%bcy ) + call bcx%fill_halos() + end associate + end subroutine +end module + + use solver_mpdata_m + class(mpdata_t), allocatable :: that + call mpdata_advop (that) +end + |