syntactically comprehensive test program

N

nobrow

I need a syntactically comprehensive test program to test a C parser
on. Does anyone know where I might find a program that uses all
syntactical elements of the language and combines them in cunning/
realistic ways so that one might be confident that a pass on this
program will mean a pass on any valid C program.

Big ask, but I thought someone might know of a suitable file(s).
 
S

santosh

I need a syntactically comprehensive test program to test a C parser
on. Does anyone know where I might find a program that uses all
syntactical elements of the language and combines them in cunning/
realistic ways so that one might be confident that a pass on this
program will mean a pass on any valid C program.

Big ask, but I thought someone might know of a suitable file(s).

gcc comes bundled with it's own test routines. I also think P.J.
Plauger's dinkumware.com offers to certify compilers and libraries for
standard conformance.
 
U

user923005

I need a syntactically comprehensive test program to test a C parser
on. Does anyone know where I might find a program that uses all
syntactical elements of the language and combines them in cunning/
realistic ways so that one might be confident that a pass on this
program will mean a pass on any valid C program.

Big ask, but I thought someone might know of a suitable file(s).


http://www.plumhall.com/suites.html
http://www.opengroup.org/testing/testsuites/perenial.htm
http://www.ace.nl/compiler/supertest.html
There's a few gazillion more here:
http://www.google.com/search?q=C+va...g.mozilla:en-US:official&hs=TeU&start=10&sa=N
 
K

Keith Thompson

santosh said:
gcc comes bundled with it's own test routines. I also think P.J.
Plauger's dinkumware.com offers to certify compilers and libraries for
standard conformance.

I haven't looked at gcc's test suite. I'm sure it includes tests for
gcc-specific extensions. Before using it, make sure that those tests
are cleanly separated from the ones that use only standard C.
 
M

Malcolm McLean

I need a syntactically comprehensive test program to test a C parser
on. Does anyone know where I might find a program that uses all
syntactical elements of the language and combines them in cunning/
realistic ways so that one might be confident that a pass on this
program will mean a pass on any valid C program.

Big ask, but I thought someone might know of a suitable file(s).
Look for a program called C torture, which is designed to stress compilers.

Unfortunately it is extremely difficult to verify that a grammar parser is
correct. Non-artificial bugs will often fail to manifest themselves on the
vast majority of inputs. C torture is a good test, but not definitive by any
means, which is why ANSI haven't endorsed it or any similar test suite.
 
C

CBFalconer

Malcolm said:
Look for a program called C torture, which is designed to stress
compilers.

Unfortunately it is extremely difficult to verify that a grammar
parser is correct. Non-artificial bugs will often fail to
manifest themselves on the vast majority of inputs. C torture is
a good test, but not definitive by any means, which is why ANSI
haven't endorsed it or any similar test suite.

It is hard to test that a compiler system is correct. It is much
easier to test that it adheres to a specific clause in the
standard. This was the approach taken 25 years ago in the Pascal
Test Suite, which unfortunately got hidden by Prospero, when the
original had been open to all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top