https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61156
--- Comment #8 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- (In reply to Dominique d'Humieres from comment #7) > With the patch in comment 6 the test gfortran.dg/include_6.f90 has to be > updated to > > --- ../_clean/gcc/testsuite/gfortran.dg/include_6.f90 2012-08-02 > 01:26:03.000000000 +0200 > +++ gcc/testsuite/gfortran.dg/include_6.f90 2016-02-23 16:32:18.000000000 > +0100 > @@ -1,5 +1,5 @@ > ! { dg-do compile } > ! { dg-options "-I gfortran.log" } > -! { dg-warning "is not a directory" "" { target *-*-* } 0 } > +! { dg-error "is not a directory" "" { target *-*-* } 0 } > end > - > +! { dg-prune-output "compilation terminated." } I did not think about trying prune, I did try dg-excess_error. I will try your idea first.