From d4eb366841e828ee8ee69b538983531a8b786061 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Wed, 14 Sep 2011 08:27:25 +0200 Subject: [PATCH] Really add: 2011-09-14 Tobias Burnus PR fortran/34547 PR fortran/50375 * gfortran.dg/null_5.f90: New. * gfortran.dg/null_6.f90: New. From-SVN: r178842 --- gcc/testsuite/gfortran.dg/null_5.f90 | 43 ++++++++++++++++++++++++++++ gcc/testsuite/gfortran.dg/null_6.f90 | 34 ++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/null_5.f90 create mode 100644 gcc/testsuite/gfortran.dg/null_6.f90 diff --git a/gcc/testsuite/gfortran.dg/null_5.f90 b/gcc/testsuite/gfortran.dg/null_5.f90 new file mode 100644 index 00000000000..886a6a1ff8b --- /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 00000000000..dd517cfa3e2 --- /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 -- 2.30.2