aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique d'Humieres <dominiq@gcc.gnu.org>2016-02-20 15:10:55 +0100
committerDominique d'Humieres <dominiq@gcc.gnu.org>2016-02-20 15:10:55 +0100
commitbbf27208564cdf8fb583f958ec5d910c3a7d9718 (patch)
tree735e0bf163c0b7e5a14149ec84f235a985a9bee7
parent34b1816913859863ab43139e5fae287e1a91b8ee (diff)
downloadgcc-bbf27208564cdf8fb583f958ec5d910c3a7d9718.zip
gcc-bbf27208564cdf8fb583f958ec5d910c3a7d9718.tar.gz
gcc-bbf27208564cdf8fb583f958ec5d910c3a7d9718.tar.bz2
[multiple changes]
2016-02-20 Dominique d'Humieres <dominiq@lps.ens.fr> PR fortran/57365 gfortran.dg/allocate_with_source_18.f03: New test. 2016-02-20 Harald Anlauf <anlauf@gmx.de> PR fortran/52531 gfortran.dg/gomp/pr52531.f90: New test. From-SVN: r233588
-rw-r--r--gcc/testsuite/ChangeLog10
-rw-r--r--gcc/testsuite/gfortran.dg/allocate_with_source_18.f0331
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr52531.f9016
3 files changed, 57 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9f70ed4..77a4c01 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2016-02-20 Dominique d'Humieres <dominiq@lps.ens.fr>
+
+ PR fortran/57365
+ gfortran.dg/allocate_with_source_18.f03: New test.
+
+2016-02-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/52531
+ gfortran.dg/gomp/pr52531.f90: New test.
+
2016-02-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/69865
diff --git a/gcc/testsuite/gfortran.dg/allocate_with_source_18.f03 b/gcc/testsuite/gfortran.dg/allocate_with_source_18.f03
new file mode 100644
index 0000000..746bd0d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocate_with_source_18.f03
@@ -0,0 +1,31 @@
+! { dg-do run }
+!
+! PR fortran/57365
+! [OOP] Sourced allocation fails with unlimited polymorphism
+! Contributed by <rxs@hotmail.de>
+!
+program bug
+
+ implicit none
+ character(len=:), allocatable :: test
+
+ test = "A test case"
+ call allocate_test(test)
+ deallocate(test)
+
+contains
+
+ subroutine allocate_test(var)
+ class(*) :: var
+ class(*), pointer :: copyofvar
+ allocate(copyofvar, source=var)
+ select type (copyofvar)
+ type is (character(len=*))
+! print*, len(copyofvar), copyofvar
+ if (len(copyofvar) /= 11) call abort ()
+ if (copyofvar /= "A test case") call abort ()
+ end select
+ deallocate(copyofvar)
+ end subroutine
+
+end program bug
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr52531.f90 b/gcc/testsuite/gfortran.dg/gomp/pr52531.f90
new file mode 100644
index 0000000..e39d359
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr52531.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+! PR fortran/52531
+module test_mod
+ type, public :: test_type
+ end type
+contains
+ subroutine foo(bar)
+ type(test_type) :: bar
+!$omp parallel default(none) shared(bar) ! Compiles if one removes default(none)
+ call question(bar)
+!$omp end parallel
+ end subroutine
+ subroutine question(var)
+ class(test_type), intent(in) :: var ! Compiles if one replaces class by type
+ end subroutine
+end module