This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] OpenCL datatypes test fixes
On Wednesday, February 16, 2011 11:24:21 am Andreas Schwab wrote:
> Ken Werner <ken@linux.vnet.ibm.com> writes:
> > On Tuesday, February 15, 2011 10:01:55 pm Ulrich Weigand wrote:
> >> Ken Werner wrote:
> >> > -gdb_test "whatis c2" "type = char \\\[2\\\]"
> >> > +gdb_test "whatis c2" "type = char2|char \\\[2\\\]"
> >>
> >> Don't we need some parentheses here (and everywere you've
> >> introduced alternatives via |)? Otherwise, it seems that
> >> this would stop working with the older compilers ...
> >
> > Hi Ulrich,
> >
> > Thanks for looking into this patch. Sometimes the GDB testsuite is a
> > mystery to me. This time it seems to work without parentheses:
> >
> > old compiler:
> > whatis c2
> > type = char [2]
> > (gdb) PASS: gdb.opencl/datatypes.exp: whatis c2
> >
> > new compiler:
> > whatis c2
> > type = char2
> > (gdb) PASS: gdb.opencl/datatypes.exp: whatis c2
> >
> > Any suggestions?
>
> This passes because "char \\\[2\\\]" matches (a substring of) the first
> output, but you really want to match the whole string "type = char [2]".
>
> +gdb_test "whatis c2" "type = char(2| \\\[2\\\])"
Does this also mean:
gdb_test "whatis c2" "type = .*(char(2| \\\[2\\\]))"
as suggested by Jan?
My intension was to exactly match either "char2" or "char [2]".
Thanks
Ken