syntactically comprehensive test program

Discussion in 'C Programming' started by nobrow@gmail.com, Feb 28, 2007.

  1. Guest

    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).
     
    , Feb 28, 2007
    #1
    1. Advertising

  2. santosh Guest

    wrote:
    > 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.
     
    santosh, Feb 28, 2007
    #2
    1. Advertising

  3. user923005 Guest

    On Feb 28, 3:41 am, wrote:
    > 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
     
    user923005, Feb 28, 2007
    #3
  4. "santosh" <> writes:
    > wrote:
    >> 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.


    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.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Feb 28, 2007
    #4
  5. <> wrote in message
    >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.


    --
    Free games and programming goodies.
    http://www.personal.leeds.ac.uk/~bgy1mm
     
    Malcolm McLean, Feb 28, 2007
    #5
  6. user923005 Guest

    user923005, Feb 28, 2007
    #6
  7. CBFalconer Guest

    Malcolm McLean wrote:
    > <> wrote in message
    >
    >> 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.


    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.

    --
    Chuck F (cbfalconer at maineline dot net)
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net>
     
    CBFalconer, Feb 28, 2007
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. somebody
    Replies:
    31
    Views:
    1,052
    Phlip
    May 3, 2005
  2. somebody
    Replies:
    30
    Views:
    1,011
    Ioannis Vranos
    May 7, 2005
  3. Christopher Benson-Manica

    Is this syntactically valid Java?

    Christopher Benson-Manica, Nov 7, 2007, in forum: Java
    Replies:
    16
    Views:
    644
    Daniel Pitts
    Nov 29, 2007
  4. Alan Mackenzie

    Is this syntactically valid C++?

    Alan Mackenzie, Aug 14, 2010, in forum: C++
    Replies:
    5
    Views:
    313
  5. Daniel Berger
    Replies:
    11
    Views:
    264
    Chad Fowler
    May 12, 2005
Loading...

Share This Page