On Friday, September 28, 2012 10:03 PM, Jordan Rose wrote:
On Sep 28, 2012, at 12:09 , Sean Silva <[email protected]> wrote:
Yes, that's a great point. We could add some kind of
expected-no-diagnostics
marker (or -verify-no-diagnostic switch), or to change the test to use,
say, -Werror instead of -verify (which would mean we'd no longer have
caught the missing %s), but it certainly takes the shine off the idea.
I think the expected-no-diagnostics is a good idea. It's good to have
the negative assertion described explicitly in the code, instead of
being just an "empty silence".
Would introducing the expected-no-diagnostics + the "fail if no
expected-*" behavior solve the issue then?
We have quite a few tests that currently use -verify to test that there
are
no errors. If we make this illegal, we'll have to spuriously introduce
warnings, or add this new expected-no-diagnostics. I'm mildly against
expected-no-diagnostics but I can't come up with a solid reason why. I
thought the original proposal here was to have -verify warn if the input
file had zero length, which I think would handle this issue fine.
Roping in Andy in case he has any insights to share from his earlier
-verify work.
I think my preference would be towards having an expected-no-diagnostics
marker and not creating a new -verify-no-diagnostic switch. Simply making
the -verify feature so that it must find at least one expected-* directive
would be easy (generating an error if it doesn't), and then implementing
the new directive to check that no diagnostics were generated, would again
be straight forward. This would mean adding "// expected-no-diagnostics"
into a number of test-cases, but would only add to their robustness, IMHO.
I can't immediately see a downside to this approach, and it would de-facto
catch the zero-length file problem, since it won't pick up any directives
and would therefore error.
I would be happy to throw together a patch once I'm back from my holiday
on Tuesday, if no-one else wants to do it.
Cheers,
Andy
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits