On Sun, May 11, 2025 at 8:38 PM Harald Anlauf <anl...@gmx.de> wrote:
>
> Hi Thomas,
>
> Am 11.05.25 um 12:51 schrieb Thomas Koenig via Gcc:
> > Hi Harald,
> >
> >> Hi Thomas,
> >>
> >> On 5/11/25 10:34, Thomas Koenig via Gcc wrote:
> >>> As PR120139 has shown (again), it is too easy to create regressions
> >>> for dumping C prototypes from Fortran.  The main problem
> >>> is that there is currently no test in the testsuite.
> >>>
> >
> >> for something along this variant you can try multiline-output
> >> as in the attached sample.
> >>
> >> There may be better ways...
> >
> > Hm, this could work. This would have the disadvantage that any
> > change to the generated file would show up as "regression" on
> > testing, even if it was not relevant to the test.
> >
> > Is there maybe something along the lines of "match the compiler
> > output for a certain pattern and discard everything else" in
> > dejagnu? I tried finding it in the docs, but I didn't find anything
> > that would work.
>
> the only thing that I am aware is writing multiple dg-output's with
> suitable regexes.  This allow to check that something is *present*,
> but I did not find the negation, i.e. absence of something not wanted.

I would suggest to try writing some new dejagnu harness that has
a two-stage compilation, generating the C prototypes from fortran
part of a testcase and compiling a C part of a testcase using the
prototypes.  I'm not sure whether eventually you can achieve this
with

! { dg-options "-fc-prototypes" }
! { dg-additional-sources "foo.c" }

aka, whether foo.c is then reliably compiled _after_ the fortran source

Richard.

> Good luck,
> Harald
>
> > Best regards
> >
> >      Thomas
> >
> >
>

Reply via email to