summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-14 07:03:09 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-14 07:03:09 +0000
commitd329a134cd2455f54f873318532f14938116b8b6 (patch)
tree2e790b36b33b55ae6f7b6bdff6fbf559fce5df4f /gcc/testsuite/gfortran.dg
parent9f9551c1ebf9d9421d8496c92d0f4a8c7b7571b5 (diff)
downloadgcc-d329a134cd2455f54f873318532f14938116b8b6.tar.gz
2011-03-14 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 170931 using svnmerge git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@170932 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r--gcc/testsuite/gfortran.dg/class_41.f0324
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_ifunction_2.f908
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_comp_31.f9022
3 files changed, 54 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/class_41.f03 b/gcc/testsuite/gfortran.dg/class_41.f03
new file mode 100644
index 00000000000..bcab2b4ceef
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_41.f03
@@ -0,0 +1,24 @@
+! { dg-do compile }
+!
+! PR 48059: [4.6 Regression][OOP] ICE in in gfc_conv_component_ref: character function of extended type
+!
+! Contributed by Hans-Werner Boschmann <boschmann@tp1.physik.uni-siegen.de>
+
+module a_module
+ type :: a_type
+ integer::length=0
+ end type a_type
+ type,extends(a_type) :: b_type
+ end type b_type
+contains
+ function a_string(this) result(form)
+ class(a_type),intent(in)::this
+ character(max(1,this%length))::form
+ end function a_string
+ subroutine b_sub(this)
+ class(b_type),intent(inout),target::this
+ print *,a_string(this)
+ end subroutine b_sub
+end module a_module
+
+! { dg-final { cleanup-modules "a_module" } }
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_ifunction_2.f90 b/gcc/testsuite/gfortran.dg/intrinsic_ifunction_2.f90
new file mode 100644
index 00000000000..1014cfff385
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_ifunction_2.f90
@@ -0,0 +1,8 @@
+! { dg-do run }
+! PR 48066 - this used to segfault.
+program p
+ real(8) :: empty(0, 3), square(0)
+ logical :: lempty(0, 3), lsquare(0)
+ square = sum(empty * empty, 2)
+ lsquare = any(lempty .and. lempty, 2)
+end
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_31.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_31.f90
new file mode 100644
index 00000000000..6a5d8c967e2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_31.f90
@@ -0,0 +1,22 @@
+! { dg-do compile }
+!
+! PR 47768: printing a derived-type variable with proc-pointer components
+!
+! Contributed by Arjen Markus <arjen.markus895@gmail.com>
+
+module proc_pointers
+ implicit none
+ type :: rectangle
+ real :: width, height
+ procedure(real), pointer, nopass :: get_special_area
+ end type
+end module
+
+program test_objects
+ use proc_pointers
+ implicit none
+ type(rectangle) :: rect
+ write(*,*) rect ! { dg-error "cannot have procedure pointer components" }
+end program
+
+! { dg-final { cleanup-modules "proc_pointers" } }