Using DejaGNU on GCC's Testsuite

PARAT Didier
Tue Aug 21 08:20:00 GMT 2012

Thanks, but how come nobody noticed that some of these tests
(gcc.dg/pr27528.c and some others) needed the line 
{ dg-options "-O0" } instead of { dg-options "" } ?

From : Jonathan Wakely
On : 20/08/2012

On 20/08/2012, PARAT Didier <> wrote:
> Hi,
> I am using DejaGNU on GCC's Testsuite and a problem appeared to me, some
> tests fail when they shouldn't be.
> For example: The test gcc.dg/pr27528.c has the line " /* { dg-options "" }
> */ " which means that this test should be compiled without any options,
> right?

Wrong. It means an empty string should be appended to the list of
default optio.s (at least that's what it means for libstdc++ tests,
where the defaults come from scripts/testsuite_flags)

> But DejaGNU seems to pass some basic options anyway (for ex. -O1,
> -O2, etc...) and this causes the test to fail because it is meant to be
> tested without optimizations.
 Then maybe it should use { dg-options "-O0" }

> I saw this problem with a lot more testcases causing them to have two
> optimization level in the same command line "gcc ... -O1 -O2 -o ...". This
> problem seems to happen when the testcase has some specific options in the
> line dg_options, for ex. " /* { dg-options "-O2" } */ ".

That's not a problem, the last -On option overrides any earlier ones.

> Did anyone ever try to run the GCC testsuite with DejaGNU and notice this
> kind of things?
> I'm using DejaGNU 1.5
> Thanks,
> Didier

More information about the Gcc mailing list