[patch, fortran] Fix PR 54033, problems with -I

Janis Johnson janis_johnson@mentor.com
Fri Jul 27 22:15:00 GMT 2012


On 07/27/2012 01:06 PM, Thomas Koenig wrote:
> Hi Janis,
> 
>> On 07/26/2012 10:16 AM, Thomas Koenig wrote:
>>
>>> No test case because I couldn't figure out how to test for a
>>> warning with no line number.
>>
>> Try using line number 0.
> 
> That didn't work for me. Using
> 
> ! { dg-do compile }
> ! { dg-options "-I include_6.f90 -I missing_dir" }
> ! { dg-warning "not a directory" "missing directory" target *-*-* 0 }
> ! { dg-warning "does not exist" "nonexisting directory" target *-*-* 0 }
> end
> 
> got me
> 
> Warning: Include directory "include_6.f90" does not exist^M
> Warning: Include directory "missing_dir" does not exist^M
> output is:
> Warning: Include directory "include_6.f90" does not exist^M
> Warning: Include directory "missing_dir" does not exist^M
> 
> FAIL: gfortran.dg/include_6.f90  -O  (test for excess errors)
> Excess errors:
> :0:0: Warning: Include directory "include_6.f90" does not exist
> :0:0: Warning: Include directory "missing_dir" does not exist

Use "{ target *-*-* }" instead of "target *-*-*".

Notice that the two warnings have the same text, so the directive
looking for "not a directory" will fail.

Janis



More information about the Gcc-patches mailing list