Patchwork [RFA:] fix failing gfortran.dg/inquire_10.f90 for newlib targets

login
register
mail settings
Submitter Hans-Peter Nilsson
Date Jan. 20, 2013, 12:29 a.m.
Message ID <201301200029.r0K0TZbK012121@ignucius.se.axis.com>
Download mbox | patch
Permalink /patch/213891/
State New
Headers show

Comments

Hans-Peter Nilsson - Jan. 20, 2013, 12:29 a.m.
Ever since it was changed to a "run" test (from the default
"compile", i.e. just producing assembly code), the test
gfortran.dg/inquire_10.f90 has failed for newlib targets while
linking, because (besides cygwin and some linux support), newlib
doesn't have getcwd:

/tmp/ccNhxU2l.o: In function `MAIN__':
inquire_10.f90:(.text+0x22): undefined reference to `_gfortran_getcwd_i4_sub'
collect2: error: ld returned 1 exit status

Digging into the history of the test-case, it was clearly
intended as a run-target, with nothing interesting compile-wise,
so I thought best to simply disable it for newlib targets, using
the available effective-target newlib.  Just about obvious, but
not.  Tested x86_64-unknown-linux-gnu to check that I didn't
goof (tests still passes), verified that the test is now
disabled for cris-elf.

Ok to commit?

	* gfortran.dg/inquire_10.f90: Run only for non-newlib targets.

brgds, H-P
Janne Blomqvist - Jan. 20, 2013, 7:14 p.m.
On Sun, Jan 20, 2013 at 2:29 AM, Hans-Peter Nilsson
<hans-peter.nilsson@axis.com> wrote:
> Ever since it was changed to a "run" test (from the default
> "compile", i.e. just producing assembly code), the test
> gfortran.dg/inquire_10.f90 has failed for newlib targets while
> linking, because (besides cygwin and some linux support), newlib
> doesn't have getcwd:
>
> /tmp/ccNhxU2l.o: In function `MAIN__':
> inquire_10.f90:(.text+0x22): undefined reference to `_gfortran_getcwd_i4_sub'
> collect2: error: ld returned 1 exit status
>
> Digging into the history of the test-case, it was clearly
> intended as a run-target, with nothing interesting compile-wise,
> so I thought best to simply disable it for newlib targets, using
> the available effective-target newlib.  Just about obvious, but
> not.  Tested x86_64-unknown-linux-gnu to check that I didn't
> goof (tests still passes), verified that the test is now
> disabled for cris-elf.
>
> Ok to commit?

Ok.

Alternatively, I don't think the getcwd() stuff in that testcase does
anything particularly useful related to the inquire functionality, so
one might instead remove lines 5, 10, and 11. Consider such a patch
pre-approved if you'd rather prefer that.

Patch

Index: gfortran.dg/inquire_10.f90
===================================================================
--- gfortran.dg/inquire_10.f90	(revision 195313)
+++ gfortran.dg/inquire_10.f90	(working copy)
@@ -1,4 +1,4 @@ 
-! { dg-do run }
+! { dg-do run { target { ! newlib } } }
   character(len=800) :: cwd
   integer :: unit