This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: New testcase for c-parse.in


On Sat, 16 Feb 2002, Neil Booth wrote:

> How about a subdirectory per chapter, e.g. "gcc.dg/std-decl"?  The idea
> being that all tests relating to the declaration chapter from all

What's a "chapter"?  ISO standards have clauses and subclauses - and
almost all tests will relate to clause 6.  (The original ANSI C89 had
sections and subsections, they became clauses and subclauses, and were
renumbered, when it was adopted as ISO C90.)  I suggest listing how you'd
propose to divide the existing standards tests into these directories.

> standards go in there.  Those that do not apply to all 3 revisions can
> be prefixed with e.g. "C99", but most tests should not require a prefix.

You'll need to write an appropriate test harness.  Tests with a prefix
should be run with -std={iso9899:1990,iso9899:199409,iso9899:1999}
-pedantic-errors, according to the prefix, unless other options are
specified (e.g. for those tests deliberately run without
-pedantic-errors), tests without a prefix should be run over all standard
versions (with -pedantic-errors).  The current situation is that most
tests *do* require a prefix since they're written for differences between
standard versions.  (This includes e.g. c99-array-nonobj-1.c, where the
uses tested for were undefined before C99, and only require a diagnostic
in C99 though we give the diagnostic outside C99 mode as well.  Or
c99-tag-1.c, where the rules in C90 were unclear (DR#165), and they were
corrected in C99 but not in a TC - and rather than attempting to make 
sense of known unclear and defective C90 rules, we implement the C99 rules 
(as further corrected by DR#251, a DR for a problem I found when fixing 
what were documented bugs in GCC in this area), but where running the test 
outside C99 mode would be inappropriate because the actual C90 wording 
wouldn't support the test.)

> 	* decl-1.c: Update, add second test.

OK.

-- 
Joseph S. Myers
jsm28@cam.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]