This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GCC testting infrastructure issue
- From: Kirill Yukhin <kirill dot yukhin at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Cc: Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Date: Wed, 28 Sep 2011 14:18:10 +0400
- Subject: GCC testting infrastructure issue
Hi folks,
I have a question. For DejaGNU we have only one option for each test.
It may be e.g. either "dg-do" compile or "dg-do run". This is really
not as suitable
For instance, we cheking some new instructio autogeneration. We have
to do 2 tests:
1. We have to write some routine which will contain a pattern which
will be generated as desired instruction. And check at runtime if that
was done correctly, comparing to some expected result. We use "dg-do
run here"
2. Next we have to check that instruction really is auto generated,
so we use "scan-assembler" for that source.
May question is: am I missed something? Is there an opportunity to
store to tests into single file? If no, why we do not have one?
Here is reduced example (from gcc.target/i386):
1.
/* run.c */
/* { dg-do run } */
int
auto_gen_insn(args...)
{
/* Code to auto-gen instruction. */
return result;
}
int
check_semantic(args...)
{
/* Code to do the same, but without desired insn. */
return result
}
int
main ()
{
if( auto_gen_insn(args...) != check_semantic(args...) )
abort ();
}
2.
/* check_gen.c */
/* { dg-do compile } */
#include "run.c"
/* { dg-final { scan-assembler-times "insn" 1 } } */
--
Thanks, k