Re: Testsuite regular expression question

2009-10-27 Thread Andreas Schwab
Steve Ellcey writes: > I am not sure what the non-capturing variant of the grouping operator > is. Is that the '?:' ? Yes, see re_syntax(n). > I have never seen that used in a scan-assembler anywhere else. None of them use grouping in first place (except for a few by accident). Andreas. --

Re: Testsuite regular expression question

2009-10-27 Thread Steve Ellcey
On Tue, 2009-10-27 at 17:59 +0100, Andreas Schwab wrote: > The regexp should not use .* in the first place, because "." also > matches the newline, and you need to use the non-capturing variant of > the grouping operator. I am not sure what the non-capturing variant of the grouping operator is. I

Re: Testsuite regular expression question

2009-10-27 Thread Steve Ellcey
So it looks like the problem isn't in the pattern matching, it is in the counting. If I use this: /* { dg-final { scan-assembler-times "data1.*?0x3.*? DW_AT_inline" 3 } } */ Everything works. If I change it to: /* { dg-final { scan-assembler-times "(data1|byte).*?0x3.*? DW_AT_inline" 3 } }

Re: Testsuite regular expression question

2009-10-27 Thread Andreas Schwab
The regexp should not use .* in the first place, because "." also matches the newline, and you need to use the non-capturing variant of the grouping operator. $ tclsh % set fd [open "~/src/gcc/gcc/gcc/testsuite/gcc.dg/debug/dwarf2/inline2.s" r] file3 % set text [read $fd] [...] % regexp -inline -a

Re: Testsuite regular expression question

2009-10-27 Thread Steve Ellcey
On Tue, 2009-10-27 at 02:09 -0400, Kaveh R. GHAZI wrote: > On Mon, 26 Oct 2009, Steve Ellcey wrote: > > > I have tried: > > /* { dg-final { scan-assembler-times "(byte|data1).*?0x3.*? DW_AT_inline" 3 > > } } */ > > /* { dg-final { scan-assembler-times "(byte\|data1).*?0x3.*? DW_AT_inline" > > 3

Re: Testsuite regular expression question

2009-10-27 Thread Andreas Schwab
Steve Ellcey writes: > I do get this test to pass. But other systems are using 'byte' so of > course I need to allow for either byte or data1. I have tried: > > /* { dg-final { scan-assembler-times "(byte|data1).*?0x3.*? DW_AT_inline" 3 } > } */ > > /* { dg-final { scan-assembler-times "(byte\

Re: Testsuite regular expression question

2009-10-26 Thread Kaveh R. GHAZI
On Mon, 26 Oct 2009, Steve Ellcey wrote: > I have tried: > /* { dg-final { scan-assembler-times "(byte|data1).*?0x3.*? DW_AT_inline" 3 } > } */ > /* { dg-final { scan-assembler-times "(byte\|data1).*?0x3.*? DW_AT_inline" 3 > } } */ > /* { dg-final { scan-assembler-times "\(byte\|data1\).*?0x3.*?

Testsuite regular expression question

2009-10-26 Thread Steve Ellcey
I am looking at a failure of gcc.dg/debug/dwarf2/inline2.c on IA64 HP-UX. The problem I have is with the assembler scan: /* { dg-final { scan-assembler-times "byte.*?0x3.*? DW_AT_inline" 3 } } */ IA64 HP-UX is using 'data1' instead of 'byte' in the output. Now that should be easy to fix and if