This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
test-suite question, dg-final/scan-file on objects?
- From: IainS <developer at sandoe-acoustics dot co dot uk>
- To: GCC Mailing List <gcc at gcc dot gnu dot org>
- Cc: Janis Johnson <janis dot marie dot johnson at gmail dot com>
- Date: Mon, 28 Jun 2010 11:38:02 +0100
- Subject: test-suite question, dg-final/scan-file on objects?
Hi,
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)
cheers
Iain