IainS <develo...@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