> -----Original Message----- > From: Jakub Jelinek <ja...@redhat.com> > Sent: Saturday, March 15, 2025 12:58 > To: Robert Dubner <rdub...@symas.com>; 'GCC Mailing List' > <gcc@gcc.gnu.org>; 'James K. Lowden' <jklow...@schemamania.org>; 'Richard > Biener' <richard.guent...@gmail.com> > Subject: Re: COBOL test cases > > On Sat, Mar 15, 2025 at 05:34:21PM +0100, Jakub Jelinek via Gcc wrote: > > So, if you have test-0001.cob and test-0001.expected-output, you could > > do for i in *.cob; do \ sed 's/\([].*()[]\)/\\\1/g;s/^/*> { dg-output > > {/;s/$/(\\n|\\r\\n|\\r)} }/;$s/.\{12\}} }$/} }/' \ < > > $i.expected-output >> $i.cob; done to turn the expected output into > > dg-output directives. > > Maybe I've missed some characters that also need to be backslash > > prefixed, in that case they'd go next to the .*() part early in the > regexp. > > Like ^$\ are certainly missing. > > Jakub
Details. Easy-peasy. I'll probably create some python scripts for doing it in a more general way for my directory structures, where each test is in its own directory. And then for UAT I'll have to extract both the source code and expected results from the .AT files. That'll just be tedious, not hard. Additional issue, although it'll definitely be done later: I don't see any way of separately compiling two source modules and linking them together. I have a number of test cases involving linking together produced-from-c.o and produced-from-cobol.o modules, because I am testing whether they can link properly. And there are issues of cobol-to-cobol linking, since slightly different things happen when calling another program in a module, and calling one compiled separately. Is there some way of doing that?