diff options
Diffstat (limited to 'gdb/testsuite/gdb.chill/builtins.exp')
-rw-r--r-- | gdb/testsuite/gdb.chill/builtins.exp | 882 |
1 files changed, 441 insertions, 441 deletions
diff --git a/gdb/testsuite/gdb.chill/builtins.exp b/gdb/testsuite/gdb.chill/builtins.exp index 87fe3af1f94..482a69500e1 100644 --- a/gdb/testsuite/gdb.chill/builtins.exp +++ b/gdb/testsuite/gdb.chill/builtins.exp @@ -1,441 +1,441 @@ -# Copyright 1995, 1996, 1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# This file tests various Chill values, expressions, and types. - -if $tracelevel then { - strace $tracelevel -} - -if [skip_chill_tests] then { continue } - -set testfile "builtins" -set srcfile ${srcdir}/$subdir/${testfile}.ch -set binfile ${objdir}/${subdir}/${testfile}.exe -if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { - perror "Couldn't compile ${srcfile}" - return -1 -} - -# Set the current language to chill. This counts as a test. If it -# fails, then we skip the other tests. - -proc set_lang_chill {} { - global gdb_prompt - global binfile objdir subdir - - verbose "loading file '$binfile'" - gdb_load $binfile - send_gdb "set language chill\n" - gdb_expect { - -re ".*$gdb_prompt $" {} - timeout { fail "set language chill (timeout)" ; return 0 } - } - - send_gdb "show language\n" - gdb_expect { - -re ".* source language is \"chill\".*$gdb_prompt $" { - pass "set language to \"chill\"" - send_gdb "break xx_\n" - gdb_expect { - -re ".*$gdb_prompt $" { - send_gdb "run\n" - gdb_expect -re ".*$gdb_prompt $" {} - return 1 - } - timeout { - fail "can't set breakpoint (timeout)" - return 0 - } - } - } - -re ".*$gdb_prompt $" { - fail "setting language to \"chill\"" - return 0 - } - timeout { - fail "can't show language (timeout)" - return 0 - } - } -} - -# Testing printing of a specific value. Increment passcount for -# success or issue fail message for failure. In both cases, return -# a 1 to indicate that more tests can proceed. However a timeout -# is a serious error, generates a special fail message, and causes -# a 0 to be returned to indicate that more tests are likely to fail -# as well. -# -# Args are: -# -# First one is string to send_gdb to gdb -# Second one is string to match gdb result to -# Third one is an optional message to be printed - -proc test_print_accept { args } { - global gdb_prompt - global passcount - global verbose - - if [llength $args]==3 then { - set message [lindex $args 2] - } else { - set message [lindex $args 0] - } - set sendthis [lindex $args 0] - set expectthis [lindex $args 1] - set result [gdb_test $sendthis ".* = ${expectthis}" $message] - if $result==0 {incr passcount} - return $result -} - -proc test_lower {} { - global passcount - - verbose "testing builtin LOWER" - set passcount 0 - - # discrete mode names - test_print_accept "print lower(bool)" "FALSE" - test_print_accept "print lower(char)" {'\^[(]0[)]'} - test_print_accept "print lower(byte)" "-128" - test_print_accept "print lower(ubyte)" "0" - if [istarget "alpha-*-*"] then { - test_print_accept "print lower(int)" "-2147483648" - } else { - test_print_accept "print lower(int)" "-32768" - } - test_print_accept "print lower(uint)" "0" - setup_xfail "alpha-*-*" - test_print_accept "print lower(long)" "-2147483648" - test_print_accept "print lower(ulong)" "0" - test_print_accept "print lower(m_set)" "e1" - test_print_accept "print lower(m_set_range)" "e2" - test_print_accept "print lower(m_numbered_set)" "n2" - test_print_accept "print lower(m_char_range)" "'A'" - test_print_accept "print lower(m_bool_range)" "FALSE" - test_print_accept "print lower(m_long_range)" "255" - test_print_accept "print lower(m_range)" "12" - - # discrete locations - test_print_accept "print lower(v_bool)" "FALSE" - test_print_accept "print lower(v_char)" {'\^[(]0[)]'} - test_print_accept "print lower(v_byte)" "-128" - test_print_accept "print lower(v_ubyte)" "0" - if [istarget "alpha-*-*"] then { - test_print_accept "print lower(v_int)" "-2147483648" - } else { - test_print_accept "print lower(v_int)" "-32768" - } - test_print_accept "print lower(v_uint)" "0" - setup_xfail "alpha-*-*" - test_print_accept "print lower(v_long)" "-2147483648" - test_print_accept "print lower(v_ulong)" "0" - test_print_accept "print lower(v_set)" "e1" - test_print_accept "print lower(v_set_range)" "e2" - test_print_accept "print lower(v_numbered_set)" "n2" - test_print_accept "print lower(v_char_range)" "'A'" - test_print_accept "print lower(v_bool_range)" "FALSE" - test_print_accept "print lower(v_long_range)" "255" - test_print_accept "print lower(v_range)" "12" - - # string mode names - test_print_accept "print lower(m_chars)" "0" - test_print_accept "print lower(m_chars_v)" "0" - test_print_accept "print lower(m_bits)" "0" - - # string locations - test_print_accept "print lower(v_chars)" "0" - test_print_accept "print lower(v_chars_v)" "0" - test_print_accept "print lower(v_bits)" "0" - - # string expressions - test_print_accept "print lower(\"abcd\")" "0" - test_print_accept "print lower(B'010101')" "0" - - # array mode name - test_print_accept "print lower(m_arr)" "1"; - test_print_accept "print lower(m_char_arr)" {'\^[(]0[)]'} - test_print_accept "print lower(m_bool_arr)" "FALSE" - if [istarget "alpha-*-*"] then { - test_print_accept "print lower(m_int_arr)" "-2147483648" - } else { - test_print_accept "print lower(m_int_arr)" "-32768" - } - test_print_accept "print lower(m_set_arr)" "e1" - test_print_accept "print lower(m_set_range_arr)" "e2" - test_print_accept "print lower(m_numbered_set_arr)" "n2" - test_print_accept "print lower(m_char_range_arr)" "'A'" - test_print_accept "print lower(m_bool_range_arr)" "FALSE" - test_print_accept "print lower(m_long_range_arr)" "255" - test_print_accept "print lower(m_range_arr)" "12" - - # array locations - test_print_accept "print lower(v_arr)" "1"; - test_print_accept "print lower(v_char_arr)" {'\^[(]0[)]'} - test_print_accept "print lower(v_bool_arr)" "FALSE" - if [istarget "alpha-*-*"] then { - test_print_accept "print lower(v_int_arr)" "-2147483648" - } else { - test_print_accept "print lower(v_int_arr)" "-32768" - } - test_print_accept "print lower(v_set_arr)" "e1" - test_print_accept "print lower(v_set_range_arr)" "e2" - test_print_accept "print lower(v_numbered_set_arr)" "n2" - test_print_accept "print lower(v_char_range_arr)" "'A'" - test_print_accept "print lower(v_bool_range_arr)" "FALSE" - test_print_accept "print lower(v_long_range_arr)" "255" - test_print_accept "print lower(v_range_arr)" "12" -} - -proc test_upper {} { - global passcount - - verbose "testing builtin UPPER" - set passcount 0 - - # discrete mode names - test_print_accept "print upper(bool)" "TRUE" - test_print_accept "print upper(char)" {'\^[(]255[)]'} - test_print_accept "print upper(byte)" "127" - test_print_accept "print upper(ubyte)" "255" - if [istarget "alpha-*-*"] then { - test_print_accept "print upper(int)" "2147483647" - test_print_accept "print upper(uint)" "4294967295" - setup_xfail "alpha-*-*" - test_print_accept "print upper(long)" "4294967295" - test_print_accept "print upper(ulong)" "18446744073709551615" - } else { - test_print_accept "print upper(int)" "32767" - test_print_accept "print upper(uint)" "65535" - test_print_accept "print upper(long)" "2147483647" - test_print_accept "print upper(ulong)" "4294967295" - } - test_print_accept "print upper(m_set)" "e6" - test_print_accept "print upper(m_set_range)" "e5" - test_print_accept "print upper(m_numbered_set)" "n5" - test_print_accept "print upper(m_char_range)" "'Z'" - test_print_accept "print upper(m_bool_range)" "FALSE" - test_print_accept "print upper(m_long_range)" "3211" - test_print_accept "print upper(m_range)" "28" - - # discrete locations - test_print_accept "print upper(v_bool)" "TRUE" - test_print_accept "print upper(v_char)" {'\^[(]255[)]'} - test_print_accept "print upper(v_byte)" "127" - test_print_accept "print upper(v_ubyte)" "255" - if [istarget "alpha-*-*"] then { - test_print_accept "print upper(v_int)" "2147483647" - test_print_accept "print upper(v_uint)" "4294967295" - setup_xfail "alpha-*-*" - test_print_accept "print upper(v_long)" "4294967295" - test_print_accept "print upper(v_ulong)" "18446744073709551615" - } else { - test_print_accept "print upper(v_int)" "32767" - test_print_accept "print upper(v_uint)" "65535" - test_print_accept "print upper(v_long)" "2147483647" - test_print_accept "print upper(v_ulong)" "4294967295" - } - test_print_accept "print upper(v_set)" "e6" - test_print_accept "print upper(v_set_range)" "e5" - test_print_accept "print upper(v_numbered_set)" "n5" - test_print_accept "print upper(v_char_range)" "'Z'" - test_print_accept "print upper(v_bool_range)" "FALSE" - test_print_accept "print upper(v_long_range)" "3211" - test_print_accept "print upper(v_range)" "28" - - # string mode names - test_print_accept "print upper(m_chars)" "19" - test_print_accept "print upper(m_chars_v)" "19" - test_print_accept "print upper(m_bits)" "9" - - # string locations - test_print_accept "print upper(v_chars)" "19" - test_print_accept "print upper(v_chars_v)" "19" - test_print_accept "print upper(v_bits)" "9" - - # string expressions - test_print_accept "print upper(\"abcd\")" "3" - test_print_accept "print upper(B'010101')" "5" - - # array mode name - test_print_accept "print upper(m_arr)" "10"; - test_print_accept "print upper(m_char_arr)" {'\^[(]255[)]'} - test_print_accept "print upper(m_bool_arr)" "TRUE" - if [istarget "alpha-*-*"] then { - test_print_accept "print upper(m_int_arr)" "2147483647" - } else { - test_print_accept "print upper(m_int_arr)" "32767" - } - test_print_accept "print upper(m_set_arr)" "e6" - test_print_accept "print upper(m_set_range_arr)" "e5" - test_print_accept "print upper(m_numbered_set_arr)" "n5" - test_print_accept "print upper(m_char_range_arr)" "'Z'" - test_print_accept "print upper(m_bool_range_arr)" "FALSE" - test_print_accept "print upper(m_long_range_arr)" "3211" - test_print_accept "print upper(m_range_arr)" "28" - - # array locations - test_print_accept "print upper(v_arr)" "10"; - test_print_accept "print upper(v_char_arr)" {'\^[(]255[)]'} - test_print_accept "print upper(v_bool_arr)" "TRUE" - if [istarget "alpha-*-*"] then { - test_print_accept "print upper(v_int_arr)" "2147483647" - } else { - test_print_accept "print upper(v_int_arr)" "32767" - } - test_print_accept "print upper(v_set_arr)" "e6" - test_print_accept "print upper(v_set_range_arr)" "e5" - test_print_accept "print upper(v_numbered_set_arr)" "n5" - test_print_accept "print upper(v_char_range_arr)" "'Z'" - test_print_accept "print upper(v_bool_range_arr)" "FALSE" - test_print_accept "print upper(v_long_range_arr)" "3211" - test_print_accept "print upper(v_range_arr)" "28" -} - -proc test_length {} { - global passcount - - verbose "testing builtin LENGTH" - set passcount 0 - - # string locations - test_print_accept "print length(v_chars)" "20" - test_print_accept "print length(v_chars_v)" "7"; - test_print_accept "print length(v_bits)" "10"; - - # string expressions - test_print_accept "print length(\"the quick brown fox ...\")" "23" - test_print_accept "print length(B'010101010101')" "12" - test_print_accept "print length(\"foo \" // \"bar\")" "7" - - # check some failures - setup_xfail "*-*-*" - test_print_accept "print length(m_chars)" "typename in invalid context" - setup_xfail "*-*-*" - test_print_accept "print length(v_byte)" "bad argument to LENGTH builtin" - setup_xfail "*-*-*" - test_print_accept "print length(b'000000' // b'111111')" "12" -} - -proc test_size {} { - global passcount - - verbose "testing builtin SIZE" - set passcount 0 - - # modes - test_print_accept "print size(bool)" "1" - test_print_accept "print size(char)" "1" - test_print_accept "print size(byte)" "1" - if [istarget "alpha-*-*"] then { - test_print_accept "print size(int)" "4" - test_print_accept "print size(ulong)" "8" - test_print_accept "print size(ptr)" "8" - test_print_accept "print size(m_chars_v)" "24" - test_print_accept "print size(m_struct)" "40" - } else { - test_print_accept "print size(int)" "2" - test_print_accept "print size(ulong)" "4" - test_print_accept "print size(ptr)" "4" - test_print_accept "print size(m_chars_v)" "22" - test_print_accept "print size(m_struct)" "36" - } - test_print_accept "print size(m_set)" "1" - test_print_accept "print size(m_numbered_set)" "1" - test_print_accept "print size(m_char_range)" "1" - test_print_accept "print size(m_range_arr)" "17" - test_print_accept "print size(m_chars)" "20" - test_print_accept "print size(m_bits)" "2" - - # locations - test_print_accept "print size(v_bool)" "1" - test_print_accept "print size(v_char)" "1" - test_print_accept "print size(v_byte)" "1" - if [istarget "alpha-*-*"] then { - test_print_accept "print size(v_int)" "4" - test_print_accept "print size(v_ulong)" "8" - test_print_accept "print size(v_ptr)" "8" - test_print_accept "print size(v_chars_v)" "24" - test_print_accept "print size(v_struct)" "40" - } else { - test_print_accept "print size(v_int)" "2" - test_print_accept "print size(v_ulong)" "4" - test_print_accept "print size(v_ptr)" "4" - test_print_accept "print size(v_chars_v)" "22" - test_print_accept "print size(v_struct)" "36" - } - test_print_accept "print size(v_set)" "1" - test_print_accept "print size(v_numbered_set)" "1" - test_print_accept "print size(v_char_range)" "1" - test_print_accept "print size(v_range_arr)" "17" - test_print_accept "print size(v_chars)" "20" - test_print_accept "print size(v_bits)" "2" -} - -proc test_num {} { - global passcount - - verbose "testing builtin NUM" - set passcount 0 - - # constants - test_print_accept "print num(false)" "0" - test_print_accept "print num(true)" "1" - test_print_accept "print num(10)" "10" - test_print_accept "print num(33-34)" "-1" - test_print_accept "print num('X')" "88" - test_print_accept "print num(e5)" "4" - - # locations - test_print_accept "print num(v_bool)" "0" - test_print_accept "print num(v_char)" "88" - test_print_accept "print num(v_byte)" "-30" - test_print_accept "print num(v_ubyte)" "30" - test_print_accept "print num(v_int)" "-333" - test_print_accept "print num(v_uint)" "333" - test_print_accept "print num(v_long)" "-4444" - test_print_accept "print num(v_ulong)" "4444" - test_print_accept "print num(v_set)" "2" - test_print_accept "print num(v_set_range)" "2" - test_print_accept "print num(v_numbered_set)" "35" - test_print_accept "print num(v_char_range)" "71" - test_print_accept "print num(v_long_range)" "1000" - test_print_accept "print num(v_range)" "23" -} - -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir - -gdb_test "set print sevenbit-strings" ".*" - -if [set_lang_chill] then { - # test builtins as described in chapter 6.20.3 Z.200 - test_num - test_size - test_lower - test_upper - test_length -} else { - warning "$test_name tests suppressed." -} +# OBSOLETE # Copyright 1995, 1996, 1997 Free Software Foundation, Inc. +# OBSOLETE +# OBSOLETE # This program is free software; you can redistribute it and/or modify +# OBSOLETE # it under the terms of the GNU General Public License as published by +# OBSOLETE # the Free Software Foundation; either version 2 of the License, or +# OBSOLETE # (at your option) any later version. +# OBSOLETE # +# OBSOLETE # This program is distributed in the hope that it will be useful, +# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of +# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# OBSOLETE # GNU General Public License for more details. +# OBSOLETE # +# OBSOLETE # You should have received a copy of the GNU General Public License +# OBSOLETE # along with this program; if not, write to the Free Software +# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# OBSOLETE +# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: +# OBSOLETE # bug-gdb@prep.ai.mit.edu +# OBSOLETE +# OBSOLETE # This file tests various Chill values, expressions, and types. +# OBSOLETE +# OBSOLETE if $tracelevel then { +# OBSOLETE strace $tracelevel +# OBSOLETE } +# OBSOLETE +# OBSOLETE if [skip_chill_tests] then { continue } +# OBSOLETE +# OBSOLETE set testfile "builtins" +# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch +# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe +# OBSOLETE if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { +# OBSOLETE perror "Couldn't compile ${srcfile}" +# OBSOLETE return -1 +# OBSOLETE } +# OBSOLETE +# OBSOLETE # Set the current language to chill. This counts as a test. If it +# OBSOLETE # fails, then we skip the other tests. +# OBSOLETE +# OBSOLETE proc set_lang_chill {} { +# OBSOLETE global gdb_prompt +# OBSOLETE global binfile objdir subdir +# OBSOLETE +# OBSOLETE verbose "loading file '$binfile'" +# OBSOLETE gdb_load $binfile +# OBSOLETE send_gdb "set language chill\n" +# OBSOLETE gdb_expect { +# OBSOLETE -re ".*$gdb_prompt $" {} +# OBSOLETE timeout { fail "set language chill (timeout)" ; return 0 } +# OBSOLETE } +# OBSOLETE +# OBSOLETE send_gdb "show language\n" +# OBSOLETE gdb_expect { +# OBSOLETE -re ".* source language is \"chill\".*$gdb_prompt $" { +# OBSOLETE pass "set language to \"chill\"" +# OBSOLETE send_gdb "break xx_\n" +# OBSOLETE gdb_expect { +# OBSOLETE -re ".*$gdb_prompt $" { +# OBSOLETE send_gdb "run\n" +# OBSOLETE gdb_expect -re ".*$gdb_prompt $" {} +# OBSOLETE return 1 +# OBSOLETE } +# OBSOLETE timeout { +# OBSOLETE fail "can't set breakpoint (timeout)" +# OBSOLETE return 0 +# OBSOLETE } +# OBSOLETE } +# OBSOLETE } +# OBSOLETE -re ".*$gdb_prompt $" { +# OBSOLETE fail "setting language to \"chill\"" +# OBSOLETE return 0 +# OBSOLETE } +# OBSOLETE timeout { +# OBSOLETE fail "can't show language (timeout)" +# OBSOLETE return 0 +# OBSOLETE } +# OBSOLETE } +# OBSOLETE } +# OBSOLETE +# OBSOLETE # Testing printing of a specific value. Increment passcount for +# OBSOLETE # success or issue fail message for failure. In both cases, return +# OBSOLETE # a 1 to indicate that more tests can proceed. However a timeout +# OBSOLETE # is a serious error, generates a special fail message, and causes +# OBSOLETE # a 0 to be returned to indicate that more tests are likely to fail +# OBSOLETE # as well. +# OBSOLETE # +# OBSOLETE # Args are: +# OBSOLETE # +# OBSOLETE # First one is string to send_gdb to gdb +# OBSOLETE # Second one is string to match gdb result to +# OBSOLETE # Third one is an optional message to be printed +# OBSOLETE +# OBSOLETE proc test_print_accept { args } { +# OBSOLETE global gdb_prompt +# OBSOLETE global passcount +# OBSOLETE global verbose +# OBSOLETE +# OBSOLETE if [llength $args]==3 then { +# OBSOLETE set message [lindex $args 2] +# OBSOLETE } else { +# OBSOLETE set message [lindex $args 0] +# OBSOLETE } +# OBSOLETE set sendthis [lindex $args 0] +# OBSOLETE set expectthis [lindex $args 1] +# OBSOLETE set result [gdb_test $sendthis ".* = ${expectthis}" $message] +# OBSOLETE if $result==0 {incr passcount} +# OBSOLETE return $result +# OBSOLETE } +# OBSOLETE +# OBSOLETE proc test_lower {} { +# OBSOLETE global passcount +# OBSOLETE +# OBSOLETE verbose "testing builtin LOWER" +# OBSOLETE set passcount 0 +# OBSOLETE +# OBSOLETE # discrete mode names +# OBSOLETE test_print_accept "print lower(bool)" "FALSE" +# OBSOLETE test_print_accept "print lower(char)" {'\^[(]0[)]'} +# OBSOLETE test_print_accept "print lower(byte)" "-128" +# OBSOLETE test_print_accept "print lower(ubyte)" "0" +# OBSOLETE if [istarget "alpha-*-*"] then { +# OBSOLETE test_print_accept "print lower(int)" "-2147483648" +# OBSOLETE } else { +# OBSOLETE test_print_accept "print lower(int)" "-32768" +# OBSOLETE } +# OBSOLETE test_print_accept "print lower(uint)" "0" +# OBSOLETE setup_xfail "alpha-*-*" +# OBSOLETE test_print_accept "print lower(long)" "-2147483648" +# OBSOLETE test_print_accept "print lower(ulong)" "0" +# OBSOLETE test_print_accept "print lower(m_set)" "e1" +# OBSOLETE test_print_accept "print lower(m_set_range)" "e2" +# OBSOLETE test_print_accept "print lower(m_numbered_set)" "n2" +# OBSOLETE test_print_accept "print lower(m_char_range)" "'A'" +# OBSOLETE test_print_accept "print lower(m_bool_range)" "FALSE" +# OBSOLETE test_print_accept "print lower(m_long_range)" "255" +# OBSOLETE test_print_accept "print lower(m_range)" "12" +# OBSOLETE +# OBSOLETE # discrete locations +# OBSOLETE test_print_accept "print lower(v_bool)" "FALSE" +# OBSOLETE test_print_accept "print lower(v_char)" {'\^[(]0[)]'} +# OBSOLETE test_print_accept "print lower(v_byte)" "-128" +# OBSOLETE test_print_accept "print lower(v_ubyte)" "0" +# OBSOLETE if [istarget "alpha-*-*"] then { +# OBSOLETE test_print_accept "print lower(v_int)" "-2147483648" +# OBSOLETE } else { +# OBSOLETE test_print_accept "print lower(v_int)" "-32768" +# OBSOLETE } +# OBSOLETE test_print_accept "print lower(v_uint)" "0" +# OBSOLETE setup_xfail "alpha-*-*" +# OBSOLETE test_print_accept "print lower(v_long)" "-2147483648" +# OBSOLETE test_print_accept "print lower(v_ulong)" "0" +# OBSOLETE test_print_accept "print lower(v_set)" "e1" +# OBSOLETE test_print_accept "print lower(v_set_range)" "e2" +# OBSOLETE test_print_accept "print lower(v_numbered_set)" "n2" +# OBSOLETE test_print_accept "print lower(v_char_range)" "'A'" +# OBSOLETE test_print_accept "print lower(v_bool_range)" "FALSE" +# OBSOLETE test_print_accept "print lower(v_long_range)" "255" +# OBSOLETE test_print_accept "print lower(v_range)" "12" +# OBSOLETE +# OBSOLETE # string mode names +# OBSOLETE test_print_accept "print lower(m_chars)" "0" +# OBSOLETE test_print_accept "print lower(m_chars_v)" "0" +# OBSOLETE test_print_accept "print lower(m_bits)" "0" +# OBSOLETE +# OBSOLETE # string locations +# OBSOLETE test_print_accept "print lower(v_chars)" "0" +# OBSOLETE test_print_accept "print lower(v_chars_v)" "0" +# OBSOLETE test_print_accept "print lower(v_bits)" "0" +# OBSOLETE +# OBSOLETE # string expressions +# OBSOLETE test_print_accept "print lower(\"abcd\")" "0" +# OBSOLETE test_print_accept "print lower(B'010101')" "0" +# OBSOLETE +# OBSOLETE # array mode name +# OBSOLETE test_print_accept "print lower(m_arr)" "1"; +# OBSOLETE test_print_accept "print lower(m_char_arr)" {'\^[(]0[)]'} +# OBSOLETE test_print_accept "print lower(m_bool_arr)" "FALSE" +# OBSOLETE if [istarget "alpha-*-*"] then { +# OBSOLETE test_print_accept "print lower(m_int_arr)" "-2147483648" +# OBSOLETE } else { +# OBSOLETE test_print_accept "print lower(m_int_arr)" "-32768" +# OBSOLETE } +# OBSOLETE test_print_accept "print lower(m_set_arr)" "e1" +# OBSOLETE test_print_accept "print lower(m_set_range_arr)" "e2" +# OBSOLETE test_print_accept "print lower(m_numbered_set_arr)" "n2" +# OBSOLETE test_print_accept "print lower(m_char_range_arr)" "'A'" +# OBSOLETE test_print_accept "print lower(m_bool_range_arr)" "FALSE" +# OBSOLETE test_print_accept "print lower(m_long_range_arr)" "255" +# OBSOLETE test_print_accept "print lower(m_range_arr)" "12" +# OBSOLETE +# OBSOLETE # array locations +# OBSOLETE test_print_accept "print lower(v_arr)" "1"; +# OBSOLETE test_print_accept "print lower(v_char_arr)" {'\^[(]0[)]'} +# OBSOLETE test_print_accept "print lower(v_bool_arr)" "FALSE" +# OBSOLETE if [istarget "alpha-*-*"] then { +# OBSOLETE test_print_accept "print lower(v_int_arr)" "-2147483648" +# OBSOLETE } else { +# OBSOLETE test_print_accept "print lower(v_int_arr)" "-32768" +# OBSOLETE } +# OBSOLETE test_print_accept "print lower(v_set_arr)" "e1" +# OBSOLETE test_print_accept "print lower(v_set_range_arr)" "e2" +# OBSOLETE test_print_accept "print lower(v_numbered_set_arr)" "n2" +# OBSOLETE test_print_accept "print lower(v_char_range_arr)" "'A'" +# OBSOLETE test_print_accept "print lower(v_bool_range_arr)" "FALSE" +# OBSOLETE test_print_accept "print lower(v_long_range_arr)" "255" +# OBSOLETE test_print_accept "print lower(v_range_arr)" "12" +# OBSOLETE } +# OBSOLETE +# OBSOLETE proc test_upper {} { +# OBSOLETE global passcount +# OBSOLETE +# OBSOLETE verbose "testing builtin UPPER" +# OBSOLETE set passcount 0 +# OBSOLETE +# OBSOLETE # discrete mode names +# OBSOLETE test_print_accept "print upper(bool)" "TRUE" +# OBSOLETE test_print_accept "print upper(char)" {'\^[(]255[)]'} +# OBSOLETE test_print_accept "print upper(byte)" "127" +# OBSOLETE test_print_accept "print upper(ubyte)" "255" +# OBSOLETE if [istarget "alpha-*-*"] then { +# OBSOLETE test_print_accept "print upper(int)" "2147483647" +# OBSOLETE test_print_accept "print upper(uint)" "4294967295" +# OBSOLETE setup_xfail "alpha-*-*" +# OBSOLETE test_print_accept "print upper(long)" "4294967295" +# OBSOLETE test_print_accept "print upper(ulong)" "18446744073709551615" +# OBSOLETE } else { +# OBSOLETE test_print_accept "print upper(int)" "32767" +# OBSOLETE test_print_accept "print upper(uint)" "65535" +# OBSOLETE test_print_accept "print upper(long)" "2147483647" +# OBSOLETE test_print_accept "print upper(ulong)" "4294967295" +# OBSOLETE } +# OBSOLETE test_print_accept "print upper(m_set)" "e6" +# OBSOLETE test_print_accept "print upper(m_set_range)" "e5" +# OBSOLETE test_print_accept "print upper(m_numbered_set)" "n5" +# OBSOLETE test_print_accept "print upper(m_char_range)" "'Z'" +# OBSOLETE test_print_accept "print upper(m_bool_range)" "FALSE" +# OBSOLETE test_print_accept "print upper(m_long_range)" "3211" +# OBSOLETE test_print_accept "print upper(m_range)" "28" +# OBSOLETE +# OBSOLETE # discrete locations +# OBSOLETE test_print_accept "print upper(v_bool)" "TRUE" +# OBSOLETE test_print_accept "print upper(v_char)" {'\^[(]255[)]'} +# OBSOLETE test_print_accept "print upper(v_byte)" "127" +# OBSOLETE test_print_accept "print upper(v_ubyte)" "255" +# OBSOLETE if [istarget "alpha-*-*"] then { +# OBSOLETE test_print_accept "print upper(v_int)" "2147483647" +# OBSOLETE test_print_accept "print upper(v_uint)" "4294967295" +# OBSOLETE setup_xfail "alpha-*-*" +# OBSOLETE test_print_accept "print upper(v_long)" "4294967295" +# OBSOLETE test_print_accept "print upper(v_ulong)" "18446744073709551615" +# OBSOLETE } else { +# OBSOLETE test_print_accept "print upper(v_int)" "32767" +# OBSOLETE test_print_accept "print upper(v_uint)" "65535" +# OBSOLETE test_print_accept "print upper(v_long)" "2147483647" +# OBSOLETE test_print_accept "print upper(v_ulong)" "4294967295" +# OBSOLETE } +# OBSOLETE test_print_accept "print upper(v_set)" "e6" +# OBSOLETE test_print_accept "print upper(v_set_range)" "e5" +# OBSOLETE test_print_accept "print upper(v_numbered_set)" "n5" +# OBSOLETE test_print_accept "print upper(v_char_range)" "'Z'" +# OBSOLETE test_print_accept "print upper(v_bool_range)" "FALSE" +# OBSOLETE test_print_accept "print upper(v_long_range)" "3211" +# OBSOLETE test_print_accept "print upper(v_range)" "28" +# OBSOLETE +# OBSOLETE # string mode names +# OBSOLETE test_print_accept "print upper(m_chars)" "19" +# OBSOLETE test_print_accept "print upper(m_chars_v)" "19" +# OBSOLETE test_print_accept "print upper(m_bits)" "9" +# OBSOLETE +# OBSOLETE # string locations +# OBSOLETE test_print_accept "print upper(v_chars)" "19" +# OBSOLETE test_print_accept "print upper(v_chars_v)" "19" +# OBSOLETE test_print_accept "print upper(v_bits)" "9" +# OBSOLETE +# OBSOLETE # string expressions +# OBSOLETE test_print_accept "print upper(\"abcd\")" "3" +# OBSOLETE test_print_accept "print upper(B'010101')" "5" +# OBSOLETE +# OBSOLETE # array mode name +# OBSOLETE test_print_accept "print upper(m_arr)" "10"; +# OBSOLETE test_print_accept "print upper(m_char_arr)" {'\^[(]255[)]'} +# OBSOLETE test_print_accept "print upper(m_bool_arr)" "TRUE" +# OBSOLETE if [istarget "alpha-*-*"] then { +# OBSOLETE test_print_accept "print upper(m_int_arr)" "2147483647" +# OBSOLETE } else { +# OBSOLETE test_print_accept "print upper(m_int_arr)" "32767" +# OBSOLETE } +# OBSOLETE test_print_accept "print upper(m_set_arr)" "e6" +# OBSOLETE test_print_accept "print upper(m_set_range_arr)" "e5" +# OBSOLETE test_print_accept "print upper(m_numbered_set_arr)" "n5" +# OBSOLETE test_print_accept "print upper(m_char_range_arr)" "'Z'" +# OBSOLETE test_print_accept "print upper(m_bool_range_arr)" "FALSE" +# OBSOLETE test_print_accept "print upper(m_long_range_arr)" "3211" +# OBSOLETE test_print_accept "print upper(m_range_arr)" "28" +# OBSOLETE +# OBSOLETE # array locations +# OBSOLETE test_print_accept "print upper(v_arr)" "10"; +# OBSOLETE test_print_accept "print upper(v_char_arr)" {'\^[(]255[)]'} +# OBSOLETE test_print_accept "print upper(v_bool_arr)" "TRUE" +# OBSOLETE if [istarget "alpha-*-*"] then { +# OBSOLETE test_print_accept "print upper(v_int_arr)" "2147483647" +# OBSOLETE } else { +# OBSOLETE test_print_accept "print upper(v_int_arr)" "32767" +# OBSOLETE } +# OBSOLETE test_print_accept "print upper(v_set_arr)" "e6" +# OBSOLETE test_print_accept "print upper(v_set_range_arr)" "e5" +# OBSOLETE test_print_accept "print upper(v_numbered_set_arr)" "n5" +# OBSOLETE test_print_accept "print upper(v_char_range_arr)" "'Z'" +# OBSOLETE test_print_accept "print upper(v_bool_range_arr)" "FALSE" +# OBSOLETE test_print_accept "print upper(v_long_range_arr)" "3211" +# OBSOLETE test_print_accept "print upper(v_range_arr)" "28" +# OBSOLETE } +# OBSOLETE +# OBSOLETE proc test_length {} { +# OBSOLETE global passcount +# OBSOLETE +# OBSOLETE verbose "testing builtin LENGTH" +# OBSOLETE set passcount 0 +# OBSOLETE +# OBSOLETE # string locations +# OBSOLETE test_print_accept "print length(v_chars)" "20" +# OBSOLETE test_print_accept "print length(v_chars_v)" "7"; +# OBSOLETE test_print_accept "print length(v_bits)" "10"; +# OBSOLETE +# OBSOLETE # string expressions +# OBSOLETE test_print_accept "print length(\"the quick brown fox ...\")" "23" +# OBSOLETE test_print_accept "print length(B'010101010101')" "12" +# OBSOLETE test_print_accept "print length(\"foo \" // \"bar\")" "7" +# OBSOLETE +# OBSOLETE # check some failures +# OBSOLETE setup_xfail "*-*-*" +# OBSOLETE test_print_accept "print length(m_chars)" "typename in invalid context" +# OBSOLETE setup_xfail "*-*-*" +# OBSOLETE test_print_accept "print length(v_byte)" "bad argument to LENGTH builtin" +# OBSOLETE setup_xfail "*-*-*" +# OBSOLETE test_print_accept "print length(b'000000' // b'111111')" "12" +# OBSOLETE } +# OBSOLETE +# OBSOLETE proc test_size {} { +# OBSOLETE global passcount +# OBSOLETE +# OBSOLETE verbose "testing builtin SIZE" +# OBSOLETE set passcount 0 +# OBSOLETE +# OBSOLETE # modes +# OBSOLETE test_print_accept "print size(bool)" "1" +# OBSOLETE test_print_accept "print size(char)" "1" +# OBSOLETE test_print_accept "print size(byte)" "1" +# OBSOLETE if [istarget "alpha-*-*"] then { +# OBSOLETE test_print_accept "print size(int)" "4" +# OBSOLETE test_print_accept "print size(ulong)" "8" +# OBSOLETE test_print_accept "print size(ptr)" "8" +# OBSOLETE test_print_accept "print size(m_chars_v)" "24" +# OBSOLETE test_print_accept "print size(m_struct)" "40" +# OBSOLETE } else { +# OBSOLETE test_print_accept "print size(int)" "2" +# OBSOLETE test_print_accept "print size(ulong)" "4" +# OBSOLETE test_print_accept "print size(ptr)" "4" +# OBSOLETE test_print_accept "print size(m_chars_v)" "22" +# OBSOLETE test_print_accept "print size(m_struct)" "36" +# OBSOLETE } +# OBSOLETE test_print_accept "print size(m_set)" "1" +# OBSOLETE test_print_accept "print size(m_numbered_set)" "1" +# OBSOLETE test_print_accept "print size(m_char_range)" "1" +# OBSOLETE test_print_accept "print size(m_range_arr)" "17" +# OBSOLETE test_print_accept "print size(m_chars)" "20" +# OBSOLETE test_print_accept "print size(m_bits)" "2" +# OBSOLETE +# OBSOLETE # locations +# OBSOLETE test_print_accept "print size(v_bool)" "1" +# OBSOLETE test_print_accept "print size(v_char)" "1" +# OBSOLETE test_print_accept "print size(v_byte)" "1" +# OBSOLETE if [istarget "alpha-*-*"] then { +# OBSOLETE test_print_accept "print size(v_int)" "4" +# OBSOLETE test_print_accept "print size(v_ulong)" "8" +# OBSOLETE test_print_accept "print size(v_ptr)" "8" +# OBSOLETE test_print_accept "print size(v_chars_v)" "24" +# OBSOLETE test_print_accept "print size(v_struct)" "40" +# OBSOLETE } else { +# OBSOLETE test_print_accept "print size(v_int)" "2" +# OBSOLETE test_print_accept "print size(v_ulong)" "4" +# OBSOLETE test_print_accept "print size(v_ptr)" "4" +# OBSOLETE test_print_accept "print size(v_chars_v)" "22" +# OBSOLETE test_print_accept "print size(v_struct)" "36" +# OBSOLETE } +# OBSOLETE test_print_accept "print size(v_set)" "1" +# OBSOLETE test_print_accept "print size(v_numbered_set)" "1" +# OBSOLETE test_print_accept "print size(v_char_range)" "1" +# OBSOLETE test_print_accept "print size(v_range_arr)" "17" +# OBSOLETE test_print_accept "print size(v_chars)" "20" +# OBSOLETE test_print_accept "print size(v_bits)" "2" +# OBSOLETE } +# OBSOLETE +# OBSOLETE proc test_num {} { +# OBSOLETE global passcount +# OBSOLETE +# OBSOLETE verbose "testing builtin NUM" +# OBSOLETE set passcount 0 +# OBSOLETE +# OBSOLETE # constants +# OBSOLETE test_print_accept "print num(false)" "0" +# OBSOLETE test_print_accept "print num(true)" "1" +# OBSOLETE test_print_accept "print num(10)" "10" +# OBSOLETE test_print_accept "print num(33-34)" "-1" +# OBSOLETE test_print_accept "print num('X')" "88" +# OBSOLETE test_print_accept "print num(e5)" "4" +# OBSOLETE +# OBSOLETE # locations +# OBSOLETE test_print_accept "print num(v_bool)" "0" +# OBSOLETE test_print_accept "print num(v_char)" "88" +# OBSOLETE test_print_accept "print num(v_byte)" "-30" +# OBSOLETE test_print_accept "print num(v_ubyte)" "30" +# OBSOLETE test_print_accept "print num(v_int)" "-333" +# OBSOLETE test_print_accept "print num(v_uint)" "333" +# OBSOLETE test_print_accept "print num(v_long)" "-4444" +# OBSOLETE test_print_accept "print num(v_ulong)" "4444" +# OBSOLETE test_print_accept "print num(v_set)" "2" +# OBSOLETE test_print_accept "print num(v_set_range)" "2" +# OBSOLETE test_print_accept "print num(v_numbered_set)" "35" +# OBSOLETE test_print_accept "print num(v_char_range)" "71" +# OBSOLETE test_print_accept "print num(v_long_range)" "1000" +# OBSOLETE test_print_accept "print num(v_range)" "23" +# OBSOLETE } +# OBSOLETE +# OBSOLETE # Start with a fresh gdb. +# OBSOLETE +# OBSOLETE gdb_exit +# OBSOLETE gdb_start +# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir +# OBSOLETE +# OBSOLETE gdb_test "set print sevenbit-strings" ".*" +# OBSOLETE +# OBSOLETE if [set_lang_chill] then { +# OBSOLETE # test builtins as described in chapter 6.20.3 Z.200 +# OBSOLETE test_num +# OBSOLETE test_size +# OBSOLETE test_lower +# OBSOLETE test_upper +# OBSOLETE test_length +# OBSOLETE } else { +# OBSOLETE warning "$test_name tests suppressed." +# OBSOLETE } |