From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- .../gfortran.dg/unused_artificial_dummies_1.f90 | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/unused_artificial_dummies_1.f90 (limited to 'gcc/testsuite/gfortran.dg/unused_artificial_dummies_1.f90') diff --git a/gcc/testsuite/gfortran.dg/unused_artificial_dummies_1.f90 b/gcc/testsuite/gfortran.dg/unused_artificial_dummies_1.f90 new file mode 100644 index 000000000..bfeceaf57 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/unused_artificial_dummies_1.f90 @@ -0,0 +1,50 @@ +! { dg-do compile } +! { dg-options "-Wunused-variable -Wunused-parameter" } +! This tests the fix for PR18111 in which some artificial declarations +! were being listed as unused parameters: +! (i) Array dummies, where a copy is made; +! (ii) The dummies of "entry thunks" (ie. the articial procedures that +! represent ENTRYs and call the "entry_master" function; and +! (iii) The __entry parameter of the entry_master function, which +! indentifies the calling entry thunk. +! All of these have DECL_ARTIFICIAL (tree) set. +! +! Contributed by Paul Thomas +! +module foo + implicit none +contains + +!This is the original problem + + subroutine bar(arg1, arg2, arg3, arg4, arg5) + character(len=80), intent(in) :: arg1 + character(len=80), dimension(:), intent(in) :: arg2 + integer, dimension(arg4), intent(in) :: arg3 + integer, intent(in) :: arg4 + character(len=arg4), intent(in) :: arg5 + print *, arg1, arg2, arg3, arg4, arg5 + end subroutine bar + +! This ICED with the first version of the fix because gfc_build_dummy_array_decl +! sometimes NULLS sym->backend_decl; taken from aliasing_dummy_1.f90 + + subroutine foo1 (slist, i) + character(*), dimension(*) :: slist + integer i + write (slist(i), '(2hi=,i3)') i + end subroutine foo1 + +! This tests the additions to the fix that prevent the dummies of entry thunks +! and entry_master __entry parameters from being listed as unused. + + function f1 (a) + integer, dimension (2, 2) :: a, b, f1, e1 + f1 (:, :) = 15 + a + return + entry e1 (b) + e1 (:, :) = 42 + b + end function + +end module foo +! { dg-final { cleanup-modules "foo" } } -- cgit v1.2.3