This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: test-suite question, dg-final/scan-file on objects?
- From: Ian Lance Taylor <iant at google dot com>
- To: IainS <developer at sandoe-acoustics dot co dot uk>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>, Janis Johnson <janis dot marie dot johnson at gmail dot com>
- Date: Mon, 28 Jun 2010 16:53:04 -0700
- Subject: Re: test-suite question, dg-final/scan-file on objects?
- References: <BFA70457-2DEA-489C-B913-4C49CA58EB22@sandoe-acoustics.co.uk>
IainS <developer@sandoe-acoustics.co.uk> writes:
> In the Obj{C,C++} testsuite we have cases where we want to check for
> reasonably long ascii strings in generated data.
>
> At present, this is done in some places by dg-final/scan-assembler
> constructs, but these can (and do) fail when the target assembler
> breaks long strings into shorter concatenated segments.
>
> One solution is target-specific scan-assembler statements, but makes
> the test cases less readable and more prone to maintenance error.
>
> A nicer (and, in a way, more correct) solution would be to use scan-
> file to match for the string in the object.
>
> dg-final/scan-file seems to work on all the targets I've got access
> to...
> ... however, grep tells me that scan-file is usually used on ".i"
> rather than ".o" files ... so I'd like to ask:
>
> "Is it an accepted approach to use scan-file on objects? " ... or
> "Is there an equivalent to scan-file specifically targeted at
> objects?" (nothing leaps out at me in the doc./google)
scan-file on objects seems like it should work. I don't see a better
option other than asking gcc to generate some specific recognizable
output in the assembler file for the cases in question.
Ian