diff options
author | Ben Cheng <bccheng@google.com> | 2013-03-28 11:14:20 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2013-03-28 12:40:33 -0700 |
commit | af0c51ac87ab2a87caa03fa108f0d164987a2764 (patch) | |
tree | 4b8b470f7c5b69642fdab8d0aa1fbc148d02196b /gcc-4.8/gcc/testsuite/gfortran.dg/proc_ptr_comp_13.f90 | |
parent | d87cae247d39ebf4f5a6bf25c932a14d2fdb9384 (diff) | |
download | toolchain_gcc-af0c51ac87ab2a87caa03fa108f0d164987a2764.tar.gz toolchain_gcc-af0c51ac87ab2a87caa03fa108f0d164987a2764.tar.bz2 toolchain_gcc-af0c51ac87ab2a87caa03fa108f0d164987a2764.zip |
[GCC 4.8] Initial check-in of GCC 4.8.0
Change-Id: I0719d8a6d0f69b367a6ab6f10eb75622dbf12771
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gfortran.dg/proc_ptr_comp_13.f90')
-rw-r--r-- | gcc-4.8/gcc/testsuite/gfortran.dg/proc_ptr_comp_13.f90 | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/gfortran.dg/proc_ptr_comp_13.f90 b/gcc-4.8/gcc/testsuite/gfortran.dg/proc_ptr_comp_13.f90 new file mode 100644 index 000000000..afc8f55b5 --- /dev/null +++ b/gcc-4.8/gcc/testsuite/gfortran.dg/proc_ptr_comp_13.f90 @@ -0,0 +1,37 @@ +! { dg-do run } +! +! PR 40882: [F03] infinite recursion in gfc_get_derived_type with PPC returning derived type. +! At the same time, check that a formal argument does not cause infinite recursion (PR 40870). +! +! Contributed by Janus Weil <janus@gcc.gnu.org> + +implicit none + +type :: t + integer :: data + procedure(foo), pointer, nopass :: ppc + procedure(type(t)), pointer, nopass :: ppc2 +end type + +type(t) :: o,o2 + +o%data = 1 +o%ppc => foo + +o2 = o%ppc(o) + +if (o%data /= 1) call abort() +if (o2%data /= 5) call abort() +if (.not. associated(o%ppc)) call abort() +if (associated(o2%ppc)) call abort() + +contains + + function foo(arg) + type(t) :: foo, arg + foo%data = arg%data * 5 + foo%ppc => NULL() + end function + +end + |