aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTobias Burnus <burnus@gcc.gnu.org>2011-09-14 08:27:25 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2011-09-14 08:27:25 +0200
commitd4eb366841e828ee8ee69b538983531a8b786061 (patch)
tree2eef9426daadeab9cd16f7032585c726938a4913 /gcc
parentea8ad3e527332487c4e395a95d9588873a58a99b (diff)
downloadgcc-d4eb366841e828ee8ee69b538983531a8b786061.zip
gcc-d4eb366841e828ee8ee69b538983531a8b786061.tar.gz
gcc-d4eb366841e828ee8ee69b538983531a8b786061.tar.bz2
Really add:
2011-09-14 Tobias Burnus <burnus@net-b.de> PR fortran/34547 PR fortran/50375 * gfortran.dg/null_5.f90: New. * gfortran.dg/null_6.f90: New. From-SVN: r178842
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gfortran.dg/null_5.f9043
-rw-r--r--gcc/testsuite/gfortran.dg/null_6.f9034
2 files changed, 77 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/null_5.f90 b/gcc/testsuite/gfortran.dg/null_5.f90
new file mode 100644
index 0000000..886a6a1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/null_5.f90
@@ -0,0 +1,43 @@
+! { dg-do compile }
+! { dg-options "-std=f95" }
+!
+! PR fortran/34547
+! PR fortran/50375
+
+subroutine test_PR50375_1 ()
+ ! Contributed by Vittorio Zecca
+ interface gen1
+ subroutine s11 (pi)
+ integer, pointer :: pi
+ end subroutine
+ subroutine s12 (pr)
+ real, pointer :: pr
+ end subroutine
+ end interface
+ call gen1 (null ()) ! { dg-error "MOLD= required in NULL|There is no specific subroutine" }
+end subroutine test_PR50375_1
+
+subroutine test_PR50375_2 ()
+ interface gen2
+ subroutine s21 (pi)
+ integer, pointer :: pi
+ end subroutine
+ subroutine s22 (pr)
+ real, optional :: pr
+ end subroutine
+ end interface
+ call gen2 (null ()) ! OK in F95/F2003 (but not in F2008)
+end subroutine test_PR50375_2
+
+subroutine test_PR34547_1 ()
+ call proc (null ()) ! { dg-error "MOLD argument to NULL required" }
+end subroutine test_PR34547_1
+
+subroutine test_PR34547_2 ()
+ print *, null () ! { dg-error "in data transfer statement requires MOLD" }
+end subroutine test_PR34547_2
+
+subroutine test_PR34547_3 ()
+ integer, allocatable :: i(:)
+ print *, NULL(i) ! { dg-error "Fortran 2003: NULL intrinsic with allocatable MOLD" }
+end subroutine test_PR34547_3
diff --git a/gcc/testsuite/gfortran.dg/null_6.f90 b/gcc/testsuite/gfortran.dg/null_6.f90
new file mode 100644
index 0000000..dd517cf
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/null_6.f90
@@ -0,0 +1,34 @@
+! { dg-do compile }
+! { dg-options "-std=f2008" }
+!
+! PR fortran/34547
+! PR fortran/50375
+
+subroutine test_PR50375_3 ()
+ interface gen3
+ subroutine s31 (pi)
+ integer, pointer :: pi
+ end subroutine
+ subroutine s32 (pr)
+ real, allocatable :: pr(:)
+ end subroutine
+ end interface
+ call gen3 (null ()) ! OK
+end subroutine test_PR50375_3
+
+subroutine test_PR50375_2 ()
+ interface gen2
+ subroutine s21 (pi)
+ integer, pointer :: pi
+ end subroutine
+ subroutine s22 (pr)
+ real, optional :: pr
+ end subroutine
+ end interface
+ call gen2 (null ()) ! { dg-error "MOLD= required in NULL|There is no specific subroutine" }
+end subroutine test_PR50375_2
+
+subroutine test_PR34547_3 ()
+ integer, allocatable :: i(:)
+ print *, NULL(i)
+end subroutine test_PR34547_3