From ea5e6b0efed02c5f934df7420aa9fa55aa84b635 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Thu, 29 Nov 2012 18:56:23 +0000 Subject: [PATCH] ChangeLog: * opencl-lang.c (opencl_print_type): New function. (opencl_language_arch_info): Install it. testsuite/ChangeLog: * gdb.opencl/convs_casts.exp: Always expect standard vector type names. * gdb.opencl/datatypes.exp: Likewise. * gdb.opencl/operators.exp: Likewise. * gdb.opencl/vec_comps.exp: Likewise. --- gdb/ChangeLog | 5 + gdb/opencl-lang.c | 23 +- gdb/testsuite/ChangeLog | 7 + gdb/testsuite/gdb.opencl/convs_casts.exp | 10 +- gdb/testsuite/gdb.opencl/datatypes.exp | 118 ++++---- gdb/testsuite/gdb.opencl/operators.exp | 362 +++++++++++------------ gdb/testsuite/gdb.opencl/vec_comps.exp | 102 +++---- 7 files changed, 330 insertions(+), 297 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a20bcbab2e4..1fe724d96e5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-11-29 Ulrich Weigand + + * opencl-lang.c (opencl_print_type): New function. + (opencl_language_arch_info): Install it. + 2012-11-29 Tom Tromey * contrib/ari/gdb_ari.sh: Remove rules for xasprintf and diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index b8fd9b7e622..4ef469867cb 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -961,6 +961,27 @@ Cannot perform conditional operation on vectors with different sizes")); return evaluate_subexp_c (expect_type, exp, pos, noside); } +/* Print OpenCL types. */ + +static void +opencl_print_type (struct type *type, const char *varstring, + struct ui_file *stream, int show, int level, + const struct type_print_options *flags) +{ + /* We nearly always defer to C type printing, except that vector + types are considered primitive in OpenCL, and should always + be printed using their TYPE_NAME. */ + if (show > 0) + { + CHECK_TYPEDEF (type); + if (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type) + && TYPE_NAME (type) != NULL) + show = 0; + } + + c_print_type (type, varstring, stream, show, level, flags); +} + static void opencl_language_arch_info (struct gdbarch *gdbarch, struct language_arch_info *lai) @@ -1003,7 +1024,7 @@ const struct language_defn opencl_language_defn = c_printchar, /* Print a character constant */ c_printstr, /* Function to print string constant */ c_emit_char, /* Print a single char */ - c_print_type, /* Print a type using appropriate syntax */ + opencl_print_type, /* Print a type using appropriate syntax */ c_print_typedef, /* Print a typedef using appropriate syntax */ c_val_print, /* Print a value using appropriate syntax */ c_value_print, /* Print a top-level value */ diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 6b9d2cae5a4..44d2af80c21 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2012-11-29 Ulrich Weigand + + * gdb.opencl/convs_casts.exp: Always expect standard vector type names. + * gdb.opencl/datatypes.exp: Likewise. + * gdb.opencl/operators.exp: Likewise. + * gdb.opencl/vec_comps.exp: Likewise. + 2012-11-29 Jerome Guitton * gdb.ada/iwide: New testcase. diff --git a/gdb/testsuite/gdb.opencl/convs_casts.exp b/gdb/testsuite/gdb.opencl/convs_casts.exp index a230392e153..70fdaebda4a 100644 --- a/gdb/testsuite/gdb.opencl/convs_casts.exp +++ b/gdb/testsuite/gdb.opencl/convs_casts.exp @@ -67,11 +67,11 @@ proc vec_casts { name } { gdb_test "print/d (${type}8)${name}" " = \\{123, 123, 123, 123, 123, 123, 123, 123\\}" gdb_test "print/d (${type}16)${name}" " = \\{123 \\}" - gdb_test "ptype (${type}2)${name}" "${type} \\\[2\\\]" - gdb_test "ptype (${type}3)${name}" "${type} \\\[3\\\]" - gdb_test "ptype (${type}4)${name}" "${type} \\\[4\\\]" - gdb_test "ptype (${type}8)${name}" "${type} \\\[8\\\]" - gdb_test "ptype (${type}16)${name}" "${type} \\\[16\\\]" + gdb_test "ptype (${type}2)${name}" "${type}2" + gdb_test "ptype (${type}3)${name}" "${type}3" + gdb_test "ptype (${type}4)${name}" "${type}4" + gdb_test "ptype (${type}8)${name}" "${type}8" + gdb_test "ptype (${type}16)${name}" "${type}16" } } diff --git a/gdb/testsuite/gdb.opencl/datatypes.exp b/gdb/testsuite/gdb.opencl/datatypes.exp index 29935396063..fb5b26cfee3 100644 --- a/gdb/testsuite/gdb.opencl/datatypes.exp +++ b/gdb/testsuite/gdb.opencl/datatypes.exp @@ -231,168 +231,168 @@ gdb_test "print b" " = (false|0)" gdb_test "whatis c" "type = char" gdb_test "p sizeof(c)" " = 1" gdb_test "print/d c" " = 1" -gdb_test "whatis c2" "type = char(2| \\\[2\\\])" +gdb_test "whatis c2" "type = char2" gdb_test "p sizeof(c2)" " = 2" gdb_test "print c2" " = \\{1, 2\\}" if { ${opencl_version} >= 110 } { - gdb_test "whatis c3" "type = char(3| \\\[3\\\])" + gdb_test "whatis c3" "type = char3" gdb_test "p sizeof(c3)" " = 4" gdb_test "print c3" " = \\{1, 2, 3\\}" } -gdb_test "whatis c4" "type = char(4| \\\[4\\\])" +gdb_test "whatis c4" "type = char4" gdb_test "p sizeof(c4)" " = 4" gdb_test "print c4" " = \\{1, 2, 3, 4\\}" -gdb_test "whatis c8" "type = char(8| \\\[8\\\])" +gdb_test "whatis c8" "type = char8" gdb_test "p sizeof(c8)" " = 8" gdb_test "print c8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" -gdb_test "whatis c16" "type = char(16| \\\[16\\\])" +gdb_test "whatis c16" "type = char16" gdb_test "p sizeof(c16)" " = 16" gdb_test "print c16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" -gdb_test "whatis uc" "type = (uchar|unsigned char)" +gdb_test "whatis uc" "type = uchar" gdb_test "p sizeof(uc)" " = 1" gdb_test "print/d uc" " = 1" -gdb_test "whatis uc2" "type = (uchar2|(uchar|unsigned char) \\\[2\\\])" +gdb_test "whatis uc2" "type = uchar2" gdb_test "p sizeof(uc2)" " = 2" gdb_test "print uc2" " = \\{1, 2\\}" if { ${opencl_version} >= 110 } { - gdb_test "whatis uc3" "type = (uchar3|(uchar|unsigned char) \\\[3\\\])" + gdb_test "whatis uc3" "type = uchar3" gdb_test "p sizeof(uc3)" " = 4" gdb_test "print uc3" " = \\{1, 2, 3\\}" } -gdb_test "whatis uc4" "type = (uchar4|(uchar|unsigned char) \\\[4\\\])" +gdb_test "whatis uc4" "type = uchar4" gdb_test "p sizeof(uc4)" " = 4" gdb_test "print uc4" " = \\{1, 2, 3, 4\\}" -gdb_test "whatis uc8" "type = (uchar8|(uchar|unsigned char) \\\[8\\\])" +gdb_test "whatis uc8" "type = uchar8" gdb_test "p sizeof(uc8)" " = 8" gdb_test "print uc8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" -gdb_test "whatis uc16" "type = (uchar16|(uchar|unsigned char) \\\[16\\\])" +gdb_test "whatis uc16" "type = uchar16" gdb_test "p sizeof(uc16)" " = 16" gdb_test "print uc16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" gdb_test "whatis s" "type = short" gdb_test "p sizeof(s)" " = 2" gdb_test "print s" " = -1" -gdb_test "whatis s2" "type = short(2| \\\[2\\\])" +gdb_test "whatis s2" "type = short2" gdb_test "p sizeof(s2)" " = 4" gdb_test "print s2" " = \\{-1, -2\\}" if { ${opencl_version} >= 110 } { - gdb_test "whatis s3" "type = short(3| \\\[3\\\])" + gdb_test "whatis s3" "type = short3" gdb_test "p sizeof(s3)" " = 8" gdb_test "print s3" " = \\{-1, -2, -3\\}" } -gdb_test "whatis s4" "type = short(4| \\\[4\\\])" +gdb_test "whatis s4" "type = short4" gdb_test "p sizeof(s4)" " = 8" gdb_test "print s4" " = \\{-1, -2, -3, -4\\}" -gdb_test "whatis s8" "type = short(8| \\\[8\\\])" +gdb_test "whatis s8" "type = short8" gdb_test "p sizeof(s8)" " = 16" gdb_test "print s8" " = \\{-1, -2, -3, -4, -5, -6, -7, -8\\}" -gdb_test "whatis s16" "type = short(16| \\\[16\\\])" +gdb_test "whatis s16" "type = short16" gdb_test "p sizeof(s16)" " = 32" gdb_test "print s16" " = \\{-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16\\}" -gdb_test "whatis us" "type = (ushort|unsigned short)" +gdb_test "whatis us" "type = ushort" gdb_test "p sizeof(us)" " = 2" gdb_test "print us" " = 1" -gdb_test "whatis us2" "type = (ushort2|(ushort|unsigned short) \\\[2\\\])" +gdb_test "whatis us2" "type = ushort2" gdb_test "p sizeof(us2)" " = 4" gdb_test "print us2" " = \\{1, 2\\}" if { ${opencl_version} >= 110 } { - gdb_test "whatis us3" "type = (ushort3|(ushort|unsigned short) \\\[3\\\])" + gdb_test "whatis us3" "type = ushort3" gdb_test "p sizeof(us3)" " = 8" gdb_test "print us3" " = \\{1, 2, 3\\}" } -gdb_test "whatis us4" "type = (ushort4|(ushort|unsigned short) \\\[4\\\])" +gdb_test "whatis us4" "type = ushort4" gdb_test "p sizeof(us4)" " = 8" gdb_test "print us4" " = \\{1, 2, 3, 4\\}" -gdb_test "whatis us8" "type = (ushort8|(ushort|unsigned short) \\\[8\\\])" +gdb_test "whatis us8" "type = ushort8" gdb_test "p sizeof(us8)" " = 16" gdb_test "print us8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" -gdb_test "whatis us16" "type = (ushort16|(ushort|unsigned short) \\\[16\\\])" +gdb_test "whatis us16" "type = ushort16" gdb_test "p sizeof(us16)" " = 32" gdb_test "print us16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" gdb_test "whatis i" "type = int" gdb_test "p sizeof(i)" " = 4" gdb_test "print i" " = -1" -gdb_test "whatis i2" "type = int(2| \\\[2\\\])" +gdb_test "whatis i2" "type = int2" gdb_test "p sizeof(i2)" " = 8" gdb_test "print i2" " = \\{-1, -2\\}" if { ${opencl_version} >= 110 } { - gdb_test "whatis i3" "type = int(3| \\\[3\\\])" + gdb_test "whatis i3" "type = int3" gdb_test "p sizeof(i3)" " = 16" gdb_test "print i3" " = \\{-1, -2, -3\\}" } -gdb_test "whatis i4" "type = int(4| \\\[4\\\])" +gdb_test "whatis i4" "type = int4" gdb_test "p sizeof(i4)" " = 16" gdb_test "print i4" " = \\{-1, -2, -3, -4\\}" -gdb_test "whatis i8" "type = int(8| \\\[8\\\])" +gdb_test "whatis i8" "type = int8" gdb_test "p sizeof(i8)" " = 32" gdb_test "print i8" " = \\{-1, -2, -3, -4, -5, -6, -7, -8\\}" -gdb_test "whatis i16" "type = int(16| \\\[16\\\])" +gdb_test "whatis i16" "type = int16" gdb_test "p sizeof(i16)" " = 64" gdb_test "print i16" " = \\{-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16\\}" -gdb_test "whatis ui" "type = (uint|unsigned int)" +gdb_test "whatis ui" "type = uint" gdb_test "p sizeof(ui)" " = 4" gdb_test "print ui" " = 1" -gdb_test "whatis ui2" "type = (uint2|(uint|unsigned int) \\\[2\\\])" +gdb_test "whatis ui2" "type = uint2" gdb_test "p sizeof(ui2)" " = 8" gdb_test "print ui2" " = \\{1, 2\\}" if { ${opencl_version} >= 110 } { - gdb_test "whatis ui3" "type = (uint3|(uint|unsigned int) \\\[3\\\])" + gdb_test "whatis ui3" "type = uint3" gdb_test "p sizeof(ui3)" " = 16" gdb_test "print ui3" " = \\{1, 2, 3\\}" } -gdb_test "whatis ui4" "type = (uint4|(uint|unsigned int) \\\[4\\\])" +gdb_test "whatis ui4" "type = uint4" gdb_test "p sizeof(ui4)" " = 16" gdb_test "print ui4" " = \\{1, 2, 3, 4\\}" -gdb_test "whatis ui8" "type = (uint8|(uint|unsigned int) \\\[8\\\])" +gdb_test "whatis ui8" "type = uint8" gdb_test "p sizeof(ui8)" " = 32" gdb_test "print ui8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" -gdb_test "whatis ui16" "type = (uint16|(uint|unsigned int) \\\[16\\\])" +gdb_test "whatis ui16" "type = uint16" gdb_test "p sizeof(ui16)" " = 64" gdb_test "print ui16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" gdb_test "whatis l" "type = long" gdb_test "p sizeof(l)" " = 8" gdb_test "print l" " = -1" -gdb_test "whatis l2" "type = long(2| \\\[2\\\])" +gdb_test "whatis l2" "type = long2" gdb_test "p sizeof(l2)" " = 16" gdb_test "print l2" " = \\{-1, -2\\}" if { ${opencl_version} >= 110 } { - gdb_test "whatis l3" "type = long(3| \\\[3\\\])" + gdb_test "whatis l3" "type = long3" gdb_test "p sizeof(l3)" " = 32" gdb_test "print l3" " = \\{-1, -2, -3\\}" } -gdb_test "whatis l4" "type = long(4| \\\[4\\\])" +gdb_test "whatis l4" "type = long4" gdb_test "p sizeof(l4)" " = 32" gdb_test "print l4" " = \\{-1, -2, -3, -4\\}" -gdb_test "whatis l8" "type = long(8| \\\[8\\\])" +gdb_test "whatis l8" "type = long8" gdb_test "p sizeof(l8)" " = 64" gdb_test "print l8" " = \\{-1, -2, -3, -4, -5, -6, -7, -8\\}" -gdb_test "whatis l16" "type = long(16| \\\[16\\\])" +gdb_test "whatis l16" "type = long16" gdb_test "p sizeof(l16)" " = 128" gdb_test "print l16" " = \\{-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16\\}" -gdb_test "whatis ul" "type = (ulong|unsigned long)" +gdb_test "whatis ul" "type = ulong" gdb_test "p sizeof(ul)" " = 8" gdb_test "print ul" " = 1" -gdb_test "whatis ul2" "type = (ulong2|(ulong|unsigned long) \\\[2\\\])" +gdb_test "whatis ul2" "type = ulong2" gdb_test "p sizeof(ul2)" " = 16" gdb_test "print ul2" " = \\{1, 2\\}" if { ${opencl_version} >= 110 } { - gdb_test "whatis ul3" "type = (ulong3|(ulong|unsigned long) \\\[3\\\])" + gdb_test "whatis ul3" "type = ulong3" gdb_test "p sizeof(ul3)" " = 32" gdb_test "print ul3" " = \\{1, 2, 3\\}" } -gdb_test "whatis ul4" "type = (ulong4|(ulong|unsigned long) \\\[4\\\])" +gdb_test "whatis ul4" "type = ulong4" gdb_test "p sizeof(ul4)" " = 32" gdb_test "print ul4" " = \\{1, 2, 3, 4\\}" -gdb_test "whatis ul8" "type = (ulong8|(ulong|unsigned long) \\\[8\\\])" +gdb_test "whatis ul8" "type = ulong8" gdb_test "p sizeof(ul8)" " = 64" gdb_test "print ul8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" -gdb_test "whatis ul16" "type = (ulong16|(ulong|unsigned long) \\\[16\\\])" +gdb_test "whatis ul16" "type = ulong16" gdb_test "p sizeof(ul16)" " = 128" gdb_test "print ul16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" @@ -404,21 +404,21 @@ if { ${have_cl_khr_fp16} } { gdb_test "whatis h" "type = half" gdb_test "p sizeof(h)" " = 2" gdb_test "print h" " = 1" - gdb_test "whatis h2" "type = half(2| \\\[2\\\])" + gdb_test "whatis h2" "type = half2" gdb_test "p sizeof(h2)" " = 4" gdb_test "print h2" " = \\{1, 2\\}" if { ${opencl_version} >= 110 } { - gdb_test "whatis h3" "type = half(3| \\\[3\\\])" + gdb_test "whatis h3" "type = half3" gdb_test "p sizeof(h3)" " = 8" gdb_test "print h3" " = \\{1, 2, 3\\}" } - gdb_test "whatis h4" "type = half(4| \\\[4\\\])" + gdb_test "whatis h4" "type = half4" gdb_test "p sizeof(h4)" " = 8" gdb_test "print h4" " = \\{1, 2, 3, 4\\}" - gdb_test "whatis h8" "type = half(8| \\\[8\\\])" + gdb_test "whatis h8" "type = half8" gdb_test "p sizeof(h8)" " = 16" gdb_test "print h8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" - gdb_test "whatis h16" "type = half(16| \\\[16\\\])" + gdb_test "whatis h16" "type = half16" gdb_test "p sizeof(h16)" " = 16" gdb_test "print h16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" } @@ -426,21 +426,21 @@ if { ${have_cl_khr_fp16} } { gdb_test "whatis f" "type = float" gdb_test "p sizeof(f)" " = 4" gdb_test "print f" " = 1" -gdb_test "whatis f2" "type = float(2| \\\[2\\\])" +gdb_test "whatis f2" "type = float2" gdb_test "p sizeof(f2)" " = 8" gdb_test "print f2" " = \\{1, 2\\}" if { ${opencl_version} >= 110 } { - gdb_test "whatis f3" "type = float(3| \\\[3\\\])" + gdb_test "whatis f3" "type = float3" gdb_test "p sizeof(f3)" " = 16" gdb_test "print f3" " = \\{1, 2, 3\\}" } -gdb_test "whatis f4" "type = float(4| \\\[4\\\])" +gdb_test "whatis f4" "type = float4" gdb_test "p sizeof(f4)" " = 16" gdb_test "print f4" " = \\{1, 2, 3, 4\\}" -gdb_test "whatis f8" "type = float(8| \\\[8\\\])" +gdb_test "whatis f8" "type = float8" gdb_test "p sizeof(f8)" " = 32" gdb_test "print f8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" -gdb_test "whatis f16" "type = float(16| \\\[16\\\])" +gdb_test "whatis f16" "type = float16" gdb_test "p sizeof(f16)" " = 64" gdb_test "print f16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" @@ -448,21 +448,21 @@ if { ${have_cl_khr_fp64} } { gdb_test "whatis d" "type = double" gdb_test "p sizeof(d)" " = 8" gdb_test "print d" " = 1" - gdb_test "whatis d2" "type = double(2| \\\[2\\\])" + gdb_test "whatis d2" "type = double2" gdb_test "p sizeof(d2)" " = 16" gdb_test "print d2" " = \\{1, 2\\}" if { ${opencl_version} >= 110 } { - gdb_test "whatis d3" "type = double(3| \\\[3\\\])" + gdb_test "whatis d3" "type = double3" gdb_test "p sizeof(d3)" " = 32" gdb_test "print d3" " = \\{1, 2, 3\\}" } - gdb_test "whatis d4" "type = double(4| \\\[4\\\])" + gdb_test "whatis d4" "type = double4" gdb_test "p sizeof(d4)" " = 32" gdb_test "print d4" " = \\{1, 2, 3, 4\\}" - gdb_test "whatis d8" "type = double(8| \\\[8\\\])" + gdb_test "whatis d8" "type = double8" gdb_test "p sizeof(d8)" " = 64" gdb_test "print d8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" - gdb_test "whatis d16" "type = double(16| \\\[16\\\])" + gdb_test "whatis d16" "type = double16" gdb_test "p sizeof(d16)" " = 128" gdb_test "print d16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" } diff --git a/gdb/testsuite/gdb.opencl/operators.exp b/gdb/testsuite/gdb.opencl/operators.exp index 6a698f38376..e8b528bce5d 100644 --- a/gdb/testsuite/gdb.opencl/operators.exp +++ b/gdb/testsuite/gdb.opencl/operators.exp @@ -61,8 +61,8 @@ proc check_basic { name type isfloat } { gdb_test "ptype ${name}a" "type = ${type}" gdb_test "ptype ${name}b" "type = ${type}" - gdb_test "ptype ${name}4a" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4b" "type = ${type} \\\[4\\\]" + gdb_test "ptype ${name}4a" "type = ${type}4" + gdb_test "ptype ${name}4b" "type = ${type}4" if { ! ${isfloat} } { gdb_test "print/d u${name}a" " = 2" @@ -71,8 +71,8 @@ proc check_basic { name type isfloat } { gdb_test "print/d u${name}4b" " = \\{1, 2, 8, 4\\}" gdb_test "ptype u${name}a" "type = (unsigned ${type}|u${type})" gdb_test "ptype u${name}b" "type = (unsigned ${type}|u${type})" - gdb_test "ptype u${name}4a" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" + gdb_test "ptype u${name}4a" "type = u${type}4" + gdb_test "ptype u${name}4b" "type = u${type}4" } } @@ -110,15 +110,15 @@ proc check_arithmetic_ops { name type isfloat size } { gdb_test "print/d -${name}4a" " = \\{-2, -4, -8, -16\\}" # scalar with vector - gdb_test "ptype ${name}a + ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a - ${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}a * ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a / ${name}b" "type = ${type} \\\[4\\\]" + gdb_test "ptype ${name}a + ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a - ${name}b" "type = ${type}4" + gdb_test "ptype ${name}a * ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a / ${name}b" "type = ${type}4" # vector with vector - gdb_test "ptype ${name}4a + ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a - ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a * ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a / ${name}4b" "type = ${type} \\\[4\\\]" + gdb_test "ptype ${name}4a + ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a - ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a * ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a / ${name}4b" "type = ${type}4" # scalar gdb_test "ptype ${name}a++" "type = ${type}" @@ -126,12 +126,12 @@ proc check_arithmetic_ops { name type isfloat size } { gdb_test "ptype ${name}a--" "type = ${type}" gdb_test "ptype --${name}a" "type = ${type}" # vector - gdb_test "ptype ${name}4a++" "type = ${type} \\\[4\\\]" - gdb_test "ptype ++${name}4a" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a--" "type = ${type} \\\[4\\\]" - gdb_test "ptype --${name}4a" "type = ${type} \\\[4\\\]" - gdb_test "ptype +${name}4a" "type = ${type} \\\[4\\\]" - gdb_test "ptype -${name}4a" "type = ${type} \\\[4\\\]" + gdb_test "ptype ${name}4a++" "type = ${type}4" + gdb_test "ptype ++${name}4a" "type = ${type}4" + gdb_test "ptype ${name}4a--" "type = ${type}4" + gdb_test "ptype --${name}4a" "type = ${type}4" + gdb_test "ptype +${name}4a" "type = ${type}4" + gdb_test "ptype -${name}4a" "type = ${type}4" if { ${isfloat} } { # scalar with scalar @@ -237,25 +237,25 @@ proc check_arithmetic_ops { name type isfloat size } { gdb_test "ptype u${name}a--" "type = (unsigned ${type}|u${type})" gdb_test "ptype --u${name}a" "type = (unsigned ${type}|u${type})" # scalar with vector - gdb_test "ptype ${name}a % ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}a + u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a - u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}a * u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a / u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}a % u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" + gdb_test "ptype ${name}a % ${name}4b" "type = ${type}4" + gdb_test "ptype u${name}a + u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a - u${name}b" "type = u${type}4" + gdb_test "ptype u${name}a * u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a / u${name}b" "type = u${type}4" + gdb_test "ptype u${name}a % u${name}4b" "type = u${type}4" # vector with vector - gdb_test "ptype ${name}4a % ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}4a + u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a - u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a * u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a / u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a % u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a++" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype ++u${name}4a" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a--" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype --u${name}4a" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype +u${name}4a" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype -u${name}4a" "type = (unsigned ${type}|u${type}) \\\[4\\\]" + gdb_test "ptype ${name}4a % ${name}4b" "type = ${type}4" + gdb_test "ptype u${name}4a + u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a - u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a * u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a / u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a % u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a++" "type = u${type}4" + gdb_test "ptype ++u${name}4a" "type = u${type}4" + gdb_test "ptype u${name}4a--" "type = u${type}4" + gdb_test "ptype --u${name}4a" "type = u${type}4" + gdb_test "ptype +u${name}4a" "type = u${type}4" + gdb_test "ptype -u${name}4a" "type = u${type}4" } } @@ -287,39 +287,39 @@ proc check_relational_ops { name type isfloat size } { if { ${size} == 2 } { # result type should be short for half precision floating point vectors # scalar with vector - gdb_test "ptype ${name}4a > ${name}b" "type = short \\\[4\\\]" - gdb_test "ptype ${name}a < ${name}4b" "type = short \\\[4\\\]" - gdb_test "ptype ${name}4a >= ${name}b" "type = short \\\[4\\\]" - gdb_test "ptype ${name}a <= ${name}4b" "type = short \\\[4\\\]" + gdb_test "ptype ${name}4a > ${name}b" "type = short4" + gdb_test "ptype ${name}a < ${name}4b" "type = short4" + gdb_test "ptype ${name}4a >= ${name}b" "type = short4" + gdb_test "ptype ${name}a <= ${name}4b" "type = short4" # vector with vector - gdb_test "ptype ${name}4a > ${name}4b" "type = short \\\[4\\\]" - gdb_test "ptype ${name}4a < ${name}4b" "type = short \\\[4\\\]" - gdb_test "ptype ${name}4a >= ${name}4b" "type = short \\\[4\\\]" - gdb_test "ptype ${name}4a <= ${name}4b" "type = short \\\[4\\\]" + gdb_test "ptype ${name}4a > ${name}4b" "type = short4" + gdb_test "ptype ${name}4a < ${name}4b" "type = short4" + gdb_test "ptype ${name}4a >= ${name}4b" "type = short4" + gdb_test "ptype ${name}4a <= ${name}4b" "type = short4" } elseif { ${size} == 4 } { # result type should be int for single precision floating point vectors # scalar with vector - gdb_test "ptype ${name}4a > ${name}b" "type = int \\\[4\\\]" - gdb_test "ptype ${name}a < ${name}4b" "type = int \\\[4\\\]" - gdb_test "ptype ${name}4a >= ${name}b" "type = int \\\[4\\\]" - gdb_test "ptype ${name}a <= ${name}4b" "type = int \\\[4\\\]" + gdb_test "ptype ${name}4a > ${name}b" "type = int4" + gdb_test "ptype ${name}a < ${name}4b" "type = int4" + gdb_test "ptype ${name}4a >= ${name}b" "type = int4" + gdb_test "ptype ${name}a <= ${name}4b" "type = int4" # vector with vector - gdb_test "ptype ${name}4a > ${name}4b" "type = int \\\[4\\\]" - gdb_test "ptype ${name}4a < ${name}4b" "type = int \\\[4\\\]" - gdb_test "ptype ${name}4a >= ${name}4b" "type = int \\\[4\\\]" - gdb_test "ptype ${name}4a <= ${name}4b" "type = int \\\[4\\\]" + gdb_test "ptype ${name}4a > ${name}4b" "type = int4" + gdb_test "ptype ${name}4a < ${name}4b" "type = int4" + gdb_test "ptype ${name}4a >= ${name}4b" "type = int4" + gdb_test "ptype ${name}4a <= ${name}4b" "type = int4" } else { # ${size} == 8 # result type should be long for double precision floating point vectors # scalar with vector - gdb_test "ptype ${name}4a > ${name}b" "type = long \\\[4\\\]" - gdb_test "ptype ${name}a < ${name}4b" "type = long \\\[4\\\]" - gdb_test "ptype ${name}4a >= ${name}b" "type = long \\\[4\\\]" - gdb_test "ptype ${name}a <= ${name}4b" "type = long \\\[4\\\]" + gdb_test "ptype ${name}4a > ${name}b" "type = long4" + gdb_test "ptype ${name}a < ${name}4b" "type = long4" + gdb_test "ptype ${name}4a >= ${name}b" "type = long4" + gdb_test "ptype ${name}a <= ${name}4b" "type = long4" # vector with vector - gdb_test "ptype ${name}4a > ${name}4b" "type = long \\\[4\\\]" - gdb_test "ptype ${name}4a < ${name}4b" "type = long \\\[4\\\]" - gdb_test "ptype ${name}4a >= ${name}4b" "type = long \\\[4\\\]" - gdb_test "ptype ${name}4a <= ${name}4b" "type = long \\\[4\\\]" + gdb_test "ptype ${name}4a > ${name}4b" "type = long4" + gdb_test "ptype ${name}4a < ${name}4b" "type = long4" + gdb_test "ptype ${name}4a >= ${name}4b" "type = long4" + gdb_test "ptype ${name}4a <= ${name}4b" "type = long4" } } else { # scalar with scalar @@ -345,15 +345,15 @@ proc check_relational_ops { name type isfloat size } { gdb_test "ptype u${name}a <= u${name}b" "type = int" gdb_test "ptype u${name}a >= u${name}b" "type = int" # scalar with vector - gdb_test "ptype u${name}4a > u${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}a < u${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}4a >= u${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}a <= u${name}4b" "type = ${type} \\\[4\\\]" + gdb_test "ptype u${name}4a > u${name}b" "type = ${type}4" + gdb_test "ptype u${name}a < u${name}4b" "type = ${type}4" + gdb_test "ptype u${name}4a >= u${name}b" "type = ${type}4" + gdb_test "ptype u${name}a <= u${name}4b" "type = ${type}4" # vector with vector - gdb_test "ptype u${name}4a > u${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}4a < u${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}4a >= u${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}4a <= u${name}4b" "type = ${type} \\\[4\\\]" + gdb_test "ptype u${name}4a > u${name}4b" "type = ${type}4" + gdb_test "ptype u${name}4a < u${name}4b" "type = ${type}4" + gdb_test "ptype u${name}4a >= u${name}4b" "type = ${type}4" + gdb_test "ptype u${name}4a <= u${name}4b" "type = ${type}4" } } @@ -377,27 +377,27 @@ proc check_equality_ops { name type isfloat size } { if { ${size} == 2 } { # result type should be short for half precision floating point vectors # scalar with vector - gdb_test "ptype ${name}4a == ${name}b" "type = short \\\[4\\\]" - gdb_test "ptype ${name}a != ${name}4b" "type = short \\\[4\\\]" + gdb_test "ptype ${name}4a == ${name}b" "type = short4" + gdb_test "ptype ${name}a != ${name}4b" "type = short4" # vector with vector - gdb_test "ptype ${name}4a == ${name}4b" "type = short \\\[4\\\]" - gdb_test "ptype ${name}4a != ${name}4b" "type = short \\\[4\\\]" + gdb_test "ptype ${name}4a == ${name}4b" "type = short4" + gdb_test "ptype ${name}4a != ${name}4b" "type = short4" } elseif { ${size} == 4 } { # result type should be int for single precision floating point vectors # scalar with vector - gdb_test "ptype ${name}4a == ${name}b" "type = int \\\[4\\\]" - gdb_test "ptype ${name}a != ${name}4b" "type = int \\\[4\\\]" + gdb_test "ptype ${name}4a == ${name}b" "type = int4" + gdb_test "ptype ${name}a != ${name}4b" "type = int4" # vector with vector - gdb_test "ptype ${name}4a == ${name}4b" "type = int \\\[4\\\]" - gdb_test "ptype ${name}4a != ${name}4b" "type = int \\\[4\\\]" + gdb_test "ptype ${name}4a == ${name}4b" "type = int4" + gdb_test "ptype ${name}4a != ${name}4b" "type = int4" } else { # ${size} == 8 # result type should be long for double precision floating point vectors # scalar with vector - gdb_test "ptype ${name}4a == ${name}b" "type = long \\\[4\\\]" - gdb_test "ptype ${name}a != ${name}4b" "type = long \\\[4\\\]" + gdb_test "ptype ${name}4a == ${name}b" "type = long4" + gdb_test "ptype ${name}a != ${name}4b" "type = long4" # vector with vector - gdb_test "ptype ${name}4a == ${name}4b" "type = long \\\[4\\\]" - gdb_test "ptype ${name}4a != ${name}4b" "type = long \\\[4\\\]" + gdb_test "ptype ${name}4a == ${name}4b" "type = long4" + gdb_test "ptype ${name}4a != ${name}4b" "type = long4" } } else { # scalar with scalar @@ -415,11 +415,11 @@ proc check_equality_ops { name type isfloat size } { gdb_test "ptype u${name}a == u${name}b" "type = int" gdb_test "ptype u${name}a != u${name}b" "type = int" # scalar with vector - gdb_test "ptype u${name}4a == u${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}a != u${name}4b" "type = ${type} \\\[4\\\]" + gdb_test "ptype u${name}4a == u${name}b" "type = ${type}4" + gdb_test "ptype u${name}a != u${name}4b" "type = ${type}4" # vector with vector - gdb_test "ptype u${name}4a == u${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}4a != u${name}4b" "type = ${type} \\\[4\\\]" + gdb_test "ptype u${name}4a == u${name}4b" "type = ${type}4" + gdb_test "ptype u${name}4a != u${name}4b" "type = ${type}4" } } @@ -464,15 +464,15 @@ proc check_shift_ops { name type size } { gdb_test "ptype u${name}a >> u${name}b" "type = (unsigned long|ulong)" } # scalar with vector - gdb_test "ptype ${name}4a << ${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a >> ${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}4a << u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a >> u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" + gdb_test "ptype ${name}4a << ${name}b" "type = ${type}4" + gdb_test "ptype ${name}4a >> ${name}b" "type = ${type}4" + gdb_test "ptype u${name}4a << u${name}b" "type = u${type}4" + gdb_test "ptype u${name}4a >> u${name}b" "type = u${type}4" # vector with vector - gdb_test "ptype ${name}4a << ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a >> ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}4a << u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a >> u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" + gdb_test "ptype ${name}4a << ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a >> ${name}4b" "type = ${type}4" + gdb_test "ptype u${name}4a << u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a >> u${name}4b" "type = u${type}4" } # Bitwise operators @@ -523,19 +523,19 @@ proc check_bitwise_ops { name type size } { gdb_test "ptype u${name}a ^ u${name}b" "type = (unsigned long|ulong)" } # scalar with vector - gdb_test "ptype ${name}4a & ${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}a | ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a ^ ${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}4a & u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}a | u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a ^ u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" + gdb_test "ptype ${name}4a & ${name}b" "type = ${type}4" + gdb_test "ptype ${name}a | ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a ^ ${name}b" "type = ${type}4" + gdb_test "ptype u${name}4a & u${name}b" "type = u${type}4" + gdb_test "ptype u${name}a | u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a ^ u${name}b" "type = u${type}4" # vector with vector - gdb_test "ptype ${name}4a & ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a | ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a ^ ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}4a & u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a | u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a ^ u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" + gdb_test "ptype ${name}4a & ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a | ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a ^ ${name}4b" "type = ${type}4" + gdb_test "ptype u${name}4a & u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a | u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a ^ u${name}4b" "type = u${type}4" # scalar if { ${size} < 8 } { @@ -571,8 +571,8 @@ proc check_bitwise_ops { name type size } { gdb_test "ptype ~u${name}a" "type = (unsigned long|ulong)" } # vector - gdb_test "ptype ~${name}4a" "type = ${type} \\\[4\\\]" - gdb_test "ptype ~u${name}4a" "type = (unsigned ${type}|u${type}) \\\[4\\\]" + gdb_test "ptype ~${name}4a" "type = ${type}4" + gdb_test "ptype ~u${name}4a" "type = u${type}4" } # Logical operators @@ -610,30 +610,30 @@ proc check_logical_ops { name type isfloat size } { if { ${size} == 2 } { # result type should be short for half precision floating point vectors # scalar with vector - gdb_test "ptype ${name}4a && ${name}b" "type = short \\\[4\\\]" - gdb_test "ptype ${name}a || ${name}4b" "type = short \\\[4\\\]" + gdb_test "ptype ${name}4a && ${name}b" "type = short4" + gdb_test "ptype ${name}a || ${name}4b" "type = short4" # vector with vector - gdb_test "ptype !${name}4a" "type = short \\\[4\\\]" - gdb_test "ptype ${name}4a && ${name}4b" "type = short \\\[4\\\]" - gdb_test "ptype ${name}4a || ${name}4b" "type = short \\\[4\\\]" + gdb_test "ptype !${name}4a" "type = short4" + gdb_test "ptype ${name}4a && ${name}4b" "type = short4" + gdb_test "ptype ${name}4a || ${name}4b" "type = short4" } elseif { ${size} == 4 } { # result type should be int for single precision floating point vectors # scalar with vector - gdb_test "ptype ${name}4a && ${name}b" "type = int \\\[4\\\]" - gdb_test "ptype ${name}a || ${name}4b" "type = int \\\[4\\\]" + gdb_test "ptype ${name}4a && ${name}b" "type = int4" + gdb_test "ptype ${name}a || ${name}4b" "type = int4" # vector with vector - gdb_test "ptype !${name}4a" "type = int \\\[4\\\]" - gdb_test "ptype ${name}4a && ${name}4b" "type = int \\\[4\\\]" - gdb_test "ptype ${name}4a || ${name}4b" "type = int \\\[4\\\]" + gdb_test "ptype !${name}4a" "type = int4" + gdb_test "ptype ${name}4a && ${name}4b" "type = int4" + gdb_test "ptype ${name}4a || ${name}4b" "type = int4" } else { # ${size} == 8 # result type should be long for double precision floating point vectors # scalar with vector - gdb_test "ptype ${name}4a && ${name}b" "type = long \\\[4\\\]" - gdb_test "ptype ${name}a || ${name}4b" "type = long \\\[4\\\]" + gdb_test "ptype ${name}4a && ${name}b" "type = long4" + gdb_test "ptype ${name}a || ${name}4b" "type = long4" # vector with vector - gdb_test "ptype !${name}4a" "type = long \\\[4\\\]" - gdb_test "ptype ${name}4a && ${name}4b" "type = long \\\[4\\\]" - gdb_test "ptype ${name}4a || ${name}4b" "type = long \\\[4\\\]" + gdb_test "ptype !${name}4a" "type = long4" + gdb_test "ptype ${name}4a && ${name}4b" "type = long4" + gdb_test "ptype ${name}4a || ${name}4b" "type = long4" } } else { # unsigned scalar @@ -656,21 +656,21 @@ proc check_logical_ops { name type isfloat size } { # scalar gdb_test "ptype !u${name}a" "type = int" # vector - gdb_test "ptype !${name}4a" "type = ${type} \\\[4\\\]" - gdb_test "ptype !u${name}4a" "type = ${type} \\\[4\\\]" + gdb_test "ptype !${name}4a" "type = ${type}4" + gdb_test "ptype !u${name}4a" "type = ${type}4" # scalar with vector - gdb_test "ptype ${name}4a && ${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}a || ${name}4b" "type = ${type} \\\[4\\\]" + gdb_test "ptype ${name}4a && ${name}b" "type = ${type}4" + gdb_test "ptype ${name}a || ${name}4b" "type = ${type}4" # result type for unsigned vector operand is signed - gdb_test "ptype u${name}4a && u${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}a || u${name}4b" "type = ${type} \\\[4\\\]" + gdb_test "ptype u${name}4a && u${name}b" "type = ${type}4" + gdb_test "ptype u${name}a || u${name}4b" "type = ${type}4" # vector with vector - gdb_test "ptype ${name}4a && ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a || ${name}4b" "type = ${type} \\\[4\\\]" + gdb_test "ptype ${name}4a && ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a || ${name}4b" "type = ${type}4" # result type for unsigned vector operand is signed - gdb_test "ptype u${name}4a && u${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype u${name}4a || u${name}4b" "type = ${type} \\\[4\\\]" + gdb_test "ptype u${name}4a && u${name}4b" "type = ${type}4" + gdb_test "ptype u${name}4a || u${name}4b" "type = ${type}4" } } @@ -691,10 +691,10 @@ proc check_conditional_op { name type isfloat } { # scalar with scalar gdb_test "ptype ${name}a ? ${name}b : ${name}a" "type = ${type}" # scalar with vector - gdb_test "ptype ${name}4a ? ${name}4b : ${name}a" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a ? ${name}b : ${name}4a" "type = ${type} \\\[4\\\]" + gdb_test "ptype ${name}4a ? ${name}4b : ${name}a" "type = ${type}4" + gdb_test "ptype ${name}4a ? ${name}b : ${name}4a" "type = ${type}4" # vector with vector - gdb_test "ptype ${name}4a ? ${name}4b : ${name}4a" "type = ${type} \\\[4\\\]" + gdb_test "ptype ${name}4a ? ${name}4b : ${name}4a" "type = ${type}4" if { !${isfloat} } { # scalar with scalar @@ -712,10 +712,10 @@ proc check_conditional_op { name type isfloat } { # scalar with scalar gdb_test "ptype u${name}a ? u${name}b : u${name}a" "type = (unsigned ${type}|u${type})" # scalar with vector - gdb_test "ptype u${name}4a ? u${name}4b : u${name}a" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a ? u${name}b : u${name}4a" "type = (unsigned ${type}|u${type}) \\\[4\\\]" + gdb_test "ptype u${name}4a ? u${name}4b : u${name}a" "type = u${type}4" + gdb_test "ptype u${name}4a ? u${name}b : u${name}4a" "type = u${type}4" # vector with vector - gdb_test "ptype u${name}4a ? u${name}4b : u${name}4a" "type = (unsigned ${type}|u${type}) \\\[4\\\]" + gdb_test "ptype u${name}4a ? u${name}4b : u${name}4a" "type = u${type}4" } } @@ -750,17 +750,17 @@ proc check_assignment_ops { name type isfloat size } { gdb_test "ptype ${name}a *= ${name}b" "type = ${type}" gdb_test "ptype ${name}a /= ${name}b" "type = ${type}" # scalar with vector - gdb_test "ptype ${name}4a = ${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a += ${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a -= ${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4b *= ${name}a" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4b /= ${name}a" "type = ${type} \\\[4\\\]" + gdb_test "ptype ${name}4a = ${name}b" "type = ${type}4" + gdb_test "ptype ${name}4a += ${name}b" "type = ${type}4" + gdb_test "ptype ${name}4a -= ${name}b" "type = ${type}4" + gdb_test "ptype ${name}4b *= ${name}a" "type = ${type}4" + gdb_test "ptype ${name}4b /= ${name}a" "type = ${type}4" # vector with vector - gdb_test "ptype ${name}4a = ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a += ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a -= ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4b *= ${name}4a" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4b /= ${name}4a" "type = ${type} \\\[4\\\]" + gdb_test "ptype ${name}4a = ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a += ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a -= ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4b *= ${name}4a" "type = ${type}4" + gdb_test "ptype ${name}4b /= ${name}4a" "type = ${type}4" if { !${isfloat} } { # scalar with scalar @@ -813,19 +813,19 @@ proc check_assignment_ops { name type isfloat size } { gdb_test "ptype ${name}a |= ${name}b" "type = ${type}" gdb_test "ptype ${name}a ^= ${name}b" "type = ${type}" # scalar with vector - gdb_test "ptype ${name}4a %= ${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a <<= ${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a >>= ${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a &= ${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a |= ${name}b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a ^= ${name}b" "type = ${type} \\\[4\\\]" + gdb_test "ptype ${name}4a %= ${name}b" "type = ${type}4" + gdb_test "ptype ${name}4a <<= ${name}b" "type = ${type}4" + gdb_test "ptype ${name}4a >>= ${name}b" "type = ${type}4" + gdb_test "ptype ${name}4a &= ${name}b" "type = ${type}4" + gdb_test "ptype ${name}4a |= ${name}b" "type = ${type}4" + gdb_test "ptype ${name}4a ^= ${name}b" "type = ${type}4" # vector with vector - gdb_test "ptype ${name}4a %= ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a <<= ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a >>= ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a &= ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a |= ${name}4b" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}4a ^= ${name}4b" "type = ${type} \\\[4\\\]" + gdb_test "ptype ${name}4a %= ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a <<= ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a >>= ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a &= ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a |= ${name}4b" "type = ${type}4" + gdb_test "ptype ${name}4a ^= ${name}4b" "type = ${type}4" # scalar with scalar gdb_test "print/d u${name}a = u${name}b" " = 1" @@ -900,29 +900,29 @@ proc check_assignment_ops { name type isfloat size } { gdb_test "ptype u${name}a |= u${name}b" "type = (unsigned ${type}|u${type})" gdb_test "ptype u${name}a ^= u${name}b" "type = (unsigned ${type}|u${type})" # scalar with vector - gdb_test "ptype u${name}4a = u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a += u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a -= u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4b *= u${name}a" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4b /= u${name}a" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a %= u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a <<= u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a >>= u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a &= u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a |= u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a ^= u${name}b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" + gdb_test "ptype u${name}4a = u${name}b" "type = u${type}4" + gdb_test "ptype u${name}4a += u${name}b" "type = u${type}4" + gdb_test "ptype u${name}4a -= u${name}b" "type = u${type}4" + gdb_test "ptype u${name}4b *= u${name}a" "type = u${type}4" + gdb_test "ptype u${name}4b /= u${name}a" "type = u${type}4" + gdb_test "ptype u${name}4a %= u${name}b" "type = u${type}4" + gdb_test "ptype u${name}4a <<= u${name}b" "type = u${type}4" + gdb_test "ptype u${name}4a >>= u${name}b" "type = u${type}4" + gdb_test "ptype u${name}4a &= u${name}b" "type = u${type}4" + gdb_test "ptype u${name}4a |= u${name}b" "type = u${type}4" + gdb_test "ptype u${name}4a ^= u${name}b" "type = u${type}4" # vector with vector - gdb_test "ptype u${name}4a = u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a += u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a -= u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4b *= u${name}4a" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4b /= u${name}4a" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a %= u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a <<= u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a >>= u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a &= u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a |= u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" - gdb_test "ptype u${name}4a ^= u${name}4b" "type = (unsigned ${type}|u${type}) \\\[4\\\]" + gdb_test "ptype u${name}4a = u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a += u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a -= u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4b *= u${name}4a" "type = u${type}4" + gdb_test "ptype u${name}4b /= u${name}4a" "type = u${type}4" + gdb_test "ptype u${name}4a %= u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a <<= u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a >>= u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a &= u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a |= u${name}4b" "type = u${type}4" + gdb_test "ptype u${name}4a ^= u${name}4b" "type = u${type}4" } } diff --git a/gdb/testsuite/gdb.opencl/vec_comps.exp b/gdb/testsuite/gdb.opencl/vec_comps.exp index 0e699a1ff73..22ef9c0c337 100644 --- a/gdb/testsuite/gdb.opencl/vec_comps.exp +++ b/gdb/testsuite/gdb.opencl/vec_comps.exp @@ -59,7 +59,7 @@ set have_cl_khr_fp16 [get_integer_valueof "have_cl_khr_fp16" 0] # Sanity checks proc check_basic { name type size } { - gdb_test "ptype ${name}" "type = ${type} \\\[16\\\]" + gdb_test "ptype ${name}" "type = ${type}16" gdb_test "p sizeof(${name})" " = [expr ${size} * 16]" gdb_test "print/d ${name}" " = \\{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15\\}" } @@ -155,13 +155,13 @@ proc check_type { name type alttype } { gdb_test "whatis ${name}.odd.xyzw.s23" "type = ${type}2" gdb_test "whatis ${name}.xyzw.hi.odd" "type = ${alttype}|${type}" - gdb_test "ptype ${name}.lo" "type = ${type} \\\[8\\\]" - gdb_test "ptype ${name}.hi" "type = ${type} \\\[8\\\]" - gdb_test "ptype ${name}.even" "type = ${type} \\\[8\\\]" - gdb_test "ptype ${name}.odd" "type = ${type} \\\[8\\\]" + gdb_test "ptype ${name}.lo" "type = ${type}8" + gdb_test "ptype ${name}.hi" "type = ${type}8" + gdb_test "ptype ${name}.even" "type = ${type}8" + gdb_test "ptype ${name}.odd" "type = ${type}8" - gdb_test "ptype ${name}.hi.even" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}.odd.odd.lo" "type = ${type} \\\[2\\\]" + gdb_test "ptype ${name}.hi.even" "type = ${type}4" + gdb_test "ptype ${name}.odd.odd.lo" "type = ${type}2" gdb_test "ptype ${name}.even.hi.lo.odd" "type = ${alttype}|${type}" gdb_test "ptype ${name}.x" "type = ${alttype}|${type}" @@ -169,20 +169,20 @@ proc check_type { name type alttype } { gdb_test "ptype ${name}.z" "type = ${alttype}|${type}" gdb_test "ptype ${name}.w" "type = ${alttype}|${type}" - gdb_test "ptype ${name}.xy" "type = ${type} \\\[2\\\]" - gdb_test "ptype ${name}.xx" "type = ${type} \\\[2\\\]" - gdb_test "ptype ${name}.wy" "type = ${type} \\\[2\\\]" + gdb_test "ptype ${name}.xy" "type = ${type}2" + gdb_test "ptype ${name}.xx" "type = ${type}2" + gdb_test "ptype ${name}.wy" "type = ${type}2" - gdb_test "ptype ${name}.xyz" "type = ${type} \\\[3\\\]" - gdb_test "ptype ${name}.yxy" "type = ${type} \\\[3\\\]" - gdb_test "ptype ${name}.yzx" "type = ${type} \\\[3\\\]" + gdb_test "ptype ${name}.xyz" "type = ${type}3" + gdb_test "ptype ${name}.yxy" "type = ${type}3" + gdb_test "ptype ${name}.yzx" "type = ${type}3" - gdb_test "ptype ${name}.xywz" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}.zzyy" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}.wwww" "type = ${type} \\\[4\\\]" + gdb_test "ptype ${name}.xywz" "type = ${type}4" + gdb_test "ptype ${name}.zzyy" "type = ${type}4" + gdb_test "ptype ${name}.wwww" "type = ${type}4" gdb_test "ptype ${name}.xy.x" "type = ${alttype}|${type}" - gdb_test "ptype ${name}.wzyx.yy" "type = ${type} \\\[2\\\]" + gdb_test "ptype ${name}.wzyx.yy" "type = ${type}2" gdb_test "ptype ${name}.wzyx.yx.x" "type = ${alttype}|${type}" gdb_test "ptype ${name}.xyzw.w" "type = ${alttype}|${type}" @@ -192,39 +192,39 @@ proc check_type { name type alttype } { gdb_test "ptype ${name}.sf" "type = ${alttype}|${type}" gdb_test "ptype ${name}.sF" "type = ${alttype}|${type}" - gdb_test "ptype ${name}.s01" "type = ${type} \\\[2\\\]" - gdb_test "ptype ${name}.s00" "type = ${type} \\\[2\\\]" - gdb_test "ptype ${name}.sF0" "type = ${type} \\\[2\\\]" - gdb_test "ptype ${name}.S42" "type = ${type} \\\[2\\\]" - - gdb_test "ptype ${name}.s567" "type = ${type} \\\[3\\\]" - gdb_test "ptype ${name}.S333" "type = ${type} \\\[3\\\]" - gdb_test "ptype ${name}.Sf0A" "type = ${type} \\\[3\\\]" - gdb_test "ptype ${name}.SB1D" "type = ${type} \\\[3\\\]" - - gdb_test "ptype ${name}.s9876" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}.sFFFF" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}.sCafe" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}.Sf001" "type = ${type} \\\[4\\\]" - - gdb_test "ptype ${name}.s00000000" "type = ${type} \\\[8\\\]" - gdb_test "ptype ${name}.s00224466" "type = ${type} \\\[8\\\]" - gdb_test "ptype ${name}.sDEADBEEF" "type = ${type} \\\[8\\\]" - gdb_test "ptype ${name}.Sa628c193" "type = ${type} \\\[8\\\]" - - gdb_test "ptype ${name}.s0123456789aBcDeF" "type = ${type} \\\[16\\\]" - gdb_test "ptype ${name}.s0022446688AACCFF" "type = ${type} \\\[16\\\]" - gdb_test "ptype ${name}.S0123456776543210" "type = ${type} \\\[16\\\]" - gdb_test "ptype ${name}.sFEDCBA9876543210" "type = ${type} \\\[16\\\]" - - gdb_test "ptype ${name}.sfedcba98.S0246" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}.sfedcba98.S0246.s13" "type = ${type} \\\[2\\\]" + gdb_test "ptype ${name}.s01" "type = ${type}2" + gdb_test "ptype ${name}.s00" "type = ${type}2" + gdb_test "ptype ${name}.sF0" "type = ${type}2" + gdb_test "ptype ${name}.S42" "type = ${type}2" + + gdb_test "ptype ${name}.s567" "type = ${type}3" + gdb_test "ptype ${name}.S333" "type = ${type}3" + gdb_test "ptype ${name}.Sf0A" "type = ${type}3" + gdb_test "ptype ${name}.SB1D" "type = ${type}3" + + gdb_test "ptype ${name}.s9876" "type = ${type}4" + gdb_test "ptype ${name}.sFFFF" "type = ${type}4" + gdb_test "ptype ${name}.sCafe" "type = ${type}4" + gdb_test "ptype ${name}.Sf001" "type = ${type}4" + + gdb_test "ptype ${name}.s00000000" "type = ${type}8" + gdb_test "ptype ${name}.s00224466" "type = ${type}8" + gdb_test "ptype ${name}.sDEADBEEF" "type = ${type}8" + gdb_test "ptype ${name}.Sa628c193" "type = ${type}8" + + gdb_test "ptype ${name}.s0123456789aBcDeF" "type = ${type}16" + gdb_test "ptype ${name}.s0022446688AACCFF" "type = ${type}16" + gdb_test "ptype ${name}.S0123456776543210" "type = ${type}16" + gdb_test "ptype ${name}.sFEDCBA9876543210" "type = ${type}16" + + gdb_test "ptype ${name}.sfedcba98.S0246" "type = ${type}4" + gdb_test "ptype ${name}.sfedcba98.S0246.s13" "type = ${type}2" gdb_test "ptype ${name}.sfedcba98.S0246.s13.s0" "type = ${alttype}|${type}" - gdb_test "ptype ${name}.s0123456789abcdef.s22" "type = ${type} \\\[2\\\]" + gdb_test "ptype ${name}.s0123456789abcdef.s22" "type = ${type}2" - gdb_test "ptype ${name}.hi.s7654.wx" "type = ${type} \\\[2\\\]" - gdb_test "ptype ${name}.s0123456789abcdef.even.lo" "type = ${type} \\\[4\\\]" - gdb_test "ptype ${name}.odd.xyzw.s23" "type = ${type} \\\[2\\\]" + gdb_test "ptype ${name}.hi.s7654.wx" "type = ${type}2" + gdb_test "ptype ${name}.s0123456789abcdef.even.lo" "type = ${type}4" + gdb_test "ptype ${name}.odd.xyzw.s23" "type = ${type}2" gdb_test "ptype ${name}.xyzw.hi.odd" "type = ${alttype}|${type}" } @@ -267,7 +267,7 @@ proc check_sizeof { name size } { } # OpenCL vector component access -proc check_access { name type } { +proc check_access { name } { gdb_test "print/d ${name}.lo" " = \\{0, 1, 2, 3, 4, 5, 6, 7\\}" gdb_test "print/d ${name}.hi" " = \\{8, 9, 10, 11, 12, 13, 14, 15\\}" gdb_test "print/d ${name}.even" " = \\{0, 2, 4, 6, 8, 10, 12, 14\\}" @@ -364,10 +364,10 @@ proc check_access { name type } { } proc do_check { name type alttype size } { - check_basic ${name} ${alttype} ${size} + check_basic ${name} ${type} ${size} check_type ${name} ${type} ${alttype} check_sizeof ${name} ${size} - check_access ${name} ${alttype} + check_access ${name} } do_check "c16" "char" "char" 1 -- 2.30.2