From: Tobias Burnus Date: Wed, 14 Sep 2011 06:27:25 +0000 (+0200) Subject: Really add: X-Git-Tag: releases/gcc-4.7.0~3776 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d4eb366841e828ee8ee69b538983531a8b786061;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/testsuite/gfortran.dg/null_5.f90 b/gcc/testsuite/gfortran.dg/null_5.f90 new file mode 100644 index 000000000000..886a6a1ff8bb --- /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 000000000000..dd517cfa3e2b --- /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