More obsolete CHILL.

This commit is contained in:
Andrew Cagney 2002-08-02 00:25:23 +00:00
parent 794498c171
commit ba010b30d4
33 changed files with 4336 additions and 4321 deletions

View File

@ -1,3 +1,17 @@
2002-08-01 Andrew Cagney <cagney@redhat.com>
* builtins.exp, callch.exp, chillvars.exp: Make files obsolete.
* enum.exp, gch1041.exp, gch1272.exp: Make files obsolete.
* gch1280.exp, gch922.exp, gch981.exp: Make files obsolete.
* misc.exp, powerset.exp, pr-4975.exp: Make files obsolete.
* pr-5016.exp, pr-5020.exp, pr-5022.exp: Make files obsolete.
* pr-5646.exp, pr-5984.exp, pr-6292.exp: Make files obsolete.
* pr-6632.exp, pr-8134.exp, pr-8136.exp: Make files obsolete.
* pr-8405.exp, pr-8742.exp, pr-8894.exp: Make files obsolete.
* pr-9095.exp, pr-9946.exp, result.exp: Make files obsolete.
* string.exp, tests1.exp, tests2.exp: Make files obsolete.
* tuples.exp, xstruct.exp: Make files obsolete.
2001-03-06 Kevin Buettner <kevinb@redhat.com>
* builtins.exp, callch.exp, chexp.exp, chillvars.exp,

View File

@ -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 }

View File

@ -1,69 +1,69 @@
# Copyright 1995, 1996 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 that gdb can call functions in a Chill inferior.
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "callch"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
send_gdb "set language chill\n" ;
gdb_test "break callch.ch:48" ""
send_gdb "run\n"; gdb_expect -re "Breakpoint .*callch.ch:48.*$gdb_prompt $"
gdb_test {set fred(10, i)} {a is '10'; b is '12'.}
gdb_test_exact "call klaus()" {here's klaus calling.}
gdb_test_exact "call fred()" {too few arguments in function call}
# Too many arguments are allowed
gdb_test_exact "call klaus(10, 20, 30)" {here's klaus calling.}
gdb_test "print a" { = \[\(FALSE:TRUE\): \[\(FALSE:TRUE\): 1\]\]}\
"print a before king"
# Current gdb prints 255 for the results that are expected to be -1.
setup_xfail "mips*-sgi-irix*"
gdb_test {call king(a, otto[[10, 15], [20, 25]])} "x\\(FALSE, FALSE\\) = 10.*p\\(FALSE, FALSE\\) = -1.*x\\(FALSE, TRUE\\) = 15.*p\\(FALSE, TRUE\\) = -1.*x\\(TRUE, FALSE\\) = 20.*p\\(TRUE, FALSE\\) = -1.*x\\(TRUE, TRUE\\) = 25.*p\\(TRUE, TRUE\\) = -1.*"
gdb_test "print a" { = \[\(FALSE:TRUE\): \[\(FALSE:TRUE\): -1\]\]}\
"print a after king"
gdb_test_exact "call ralph(b)" {x.f1 = 10, x.f2 = FALSE.}
gdb_test "call whitney(c)" "x.f1\\(FALSE, FALSE\\) = 1.*x.f1\\(FALSE, TRUE\\) = 1.*x.f1\\(TRUE, FALSE\\) = 1.*x.f1\\(TRUE, TRUE\\) = 1.*"
}
do_tests
# OBSOLETE # Copyright 1995, 1996 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 that gdb can call functions in a Chill inferior.
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "callch"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE send_gdb "set language chill\n" ;
# OBSOLETE
# OBSOLETE gdb_test "break callch.ch:48" ""
# OBSOLETE send_gdb "run\n"; gdb_expect -re "Breakpoint .*callch.ch:48.*$gdb_prompt $"
# OBSOLETE gdb_test {set fred(10, i)} {a is '10'; b is '12'.}
# OBSOLETE gdb_test_exact "call klaus()" {here's klaus calling.}
# OBSOLETE gdb_test_exact "call fred()" {too few arguments in function call}
# OBSOLETE # Too many arguments are allowed
# OBSOLETE gdb_test_exact "call klaus(10, 20, 30)" {here's klaus calling.}
# OBSOLETE gdb_test "print a" { = \[\(FALSE:TRUE\): \[\(FALSE:TRUE\): 1\]\]}\
# OBSOLETE "print a before king"
# OBSOLETE # Current gdb prints 255 for the results that are expected to be -1.
# OBSOLETE setup_xfail "mips*-sgi-irix*"
# OBSOLETE gdb_test {call king(a, otto[[10, 15], [20, 25]])} "x\\(FALSE, FALSE\\) = 10.*p\\(FALSE, FALSE\\) = -1.*x\\(FALSE, TRUE\\) = 15.*p\\(FALSE, TRUE\\) = -1.*x\\(TRUE, FALSE\\) = 20.*p\\(TRUE, FALSE\\) = -1.*x\\(TRUE, TRUE\\) = 25.*p\\(TRUE, TRUE\\) = -1.*"
# OBSOLETE gdb_test "print a" { = \[\(FALSE:TRUE\): \[\(FALSE:TRUE\): -1\]\]}\
# OBSOLETE "print a after king"
# OBSOLETE gdb_test_exact "call ralph(b)" {x.f1 = 10, x.f2 = FALSE.}
# OBSOLETE gdb_test "call whitney(c)" "x.f1\\(FALSE, FALSE\\) = 1.*x.f1\\(FALSE, TRUE\\) = 1.*x.f1\\(TRUE, FALSE\\) = 1.*x.f1\\(TRUE, TRUE\\) = 1.*"
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,316 +1,316 @@
# Copyright 1992, 1994, 1995, 1996 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 was written by Fred Fish. (fnf@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "chillvars"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
# This is needed (at least on SunOS4) to make sure the
# the symbol table is read.
gdb_test "break chillvars.ch:3" ""
gdb_test "delete 1" ""
gdb_test "set width 0" ""
gdb_test "set print sevenbit-strings" ""
gdb_test "set print address off" ""
test_BOOL
test_CHAR
test_BYTE
test_UBYTE
test_INT
test_UINT
test_LONG
test_ULONG
test_REAL
test_LONG_REAL
test_POWERSET
test_arrays
test_strings
test_structs
test_ptr
}
proc test_BOOL {} {
gdb_test "ptype bool_true" "type = (BOOL|bool)"
gdb_test "ptype bool_false" "type = (BOOL|bool)"
gdb_test "whatis bool_true" "type = (BOOL|bool)"
gdb_test "whatis bool_false" "type = (BOOL|bool)"
gdb_test "print bool_false" " = FALSE"
gdb_test "print bool_true" " = TRUE"
}
proc test_CHAR {} {
gdb_test "ptype control_char" "type = (CHAR|char)"
gdb_test "whatis control_char" "type = (CHAR|char)"
gdb_test "print control_char" { = '\^[(]7[)]'}
gdb_test "ptype printable_char" "type = (CHAR|char)"
gdb_test "whatis printable_char" "type = (CHAR|char)"
gdb_test "print printable_char" " = 'a'"
gdb_test "print lower(char)" { = '\^[(]0[)]'}
gdb_test "print upper(char)" { = '\^[(]255[)]'}
}
proc test_BYTE {} {
gdb_test "ptype byte_low" "type = (BYTE|byte)"
gdb_test "whatis byte_low" "type = (BYTE|byte)"
gdb_test "print byte_low" " = -128"
gdb_test "ptype byte_high" "type = (BYTE|byte)"
gdb_test "whatis byte_high" "type = (BYTE|byte)"
gdb_test "print byte_high" " = 127"
gdb_test "print lower(byte)" " = -128"
gdb_test "print upper(byte)" " = 127"
gdb_test "print lower(byte_high)" " = -128"
gdb_test "print upper(byte_high)" " = 127"
}
proc test_UBYTE {} {
gdb_test "ptype ubyte_low" "type = (UBYTE|ubyte)"
gdb_test "whatis ubyte_low" "type = (UBYTE|ubyte)"
gdb_test "print ubyte_low" " = 0"
gdb_test "ptype ubyte_high" "type = (UBYTE|ubyte)"
gdb_test "whatis ubyte_high" "type = (UBYTE|ubyte)"
gdb_test "print ubyte_high" " = 255"
}
proc test_INT {} {
gdb_test "ptype int_low" "type = (INT|int)"
gdb_test "whatis int_low" "type = (INT|int)"
gdb_test "print int_low" " = -32768"
gdb_test "ptype int_high" "type = (INT|int)"
gdb_test "whatis int_high" "type = (INT|int)"
gdb_test "print int_high" " = 32767"
}
proc test_UINT {} {
gdb_test "ptype uint_low" "type = (UINT|uint)"
gdb_test "whatis uint_low" "type = (UINT|uint)"
gdb_test "print uint_low" " = 0"
gdb_test "ptype uint_high" "type = (UINT|uint)"
gdb_test "whatis uint_high" "type = (UINT|uint)"
gdb_test "print uint_high" " = 65535"
}
proc test_LONG {} {
gdb_test "ptype long_low" "type = (LONG|long)"
gdb_test "whatis long_low" "type = (LONG|long)"
gdb_test "print long_low" " = -2147483648"
gdb_test "ptype long_high" "type = (LONG|long)"
gdb_test "whatis long_high" "type = (LONG|long)"
gdb_test "print long_high" " = 2147483647"
}
proc test_ULONG {} {
gdb_test "ptype ulong_low" "type = (ULONG|ulong)"
gdb_test "whatis ulong_low" "type = (ULONG|ulong)"
gdb_test "print ulong_low" " = 0"
gdb_test "ptype ulong_high" "type = (ULONG|ulong)"
gdb_test "whatis ulong_high" "type = (ULONG|ulong)"
gdb_test "print ulong_high" " = 4294967295"
}
proc test_REAL {} {
gdb_test "ptype real1" "type = (FLOAT|float)"
gdb_test "whatis real1" "type = (FLOAT|float)"
gdb_test "print real1" " = 3.14159274"
}
proc test_LONG_REAL {} {
gdb_test "ptype long_real1" "type = (DOUBLE|double)"
gdb_test "whatis long_real1" "type = (DOUBLE|double)"
gdb_test "print long_real1" " = 3\\.1400000000000001e\\+300"
}
proc test_POWERSET {} {
}
proc test_arrays {} {
gdb_test "ptype booltable1" "type = ARRAY \\(+0:3\\)+ (BOOL|bool)"
gdb_test_exact "print booltable1" \
{ = [(0): TRUE, (1:2): FALSE, (3): TRUE]}
gdb_test "ptype booltable2" "type = ARRAY \\(+4:7\\)+ (BOOL|bool)"
gdb_test_exact "print booltable2" { = [(4): TRUE, (5:6): FALSE, (7): TRUE]}
gdb_test "ptype chartable1" "type = ARRAY \\(+0:2\\)+ (CHAR|char)"
gdb_test_exact "print chartable1" {= [(0): '^(0)', (1): '^(1)', (2): '^(2)']}
gdb_test "ptype chartable2" "type = ARRAY \\(+3:5\\)+ (CHAR|char)"
gdb_test_exact "print chartable2" \
{= [(3): '^(0)', (4): '^(1)', (5): '^(2)']}
gdb_test "ptype bytetable1" "type = ARRAY \\(+0:4\\)+ (BYTE|byte)"
gdb_test_exact "print bytetable1" \
{= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
gdb_test "ptype bytetable2" "type = ARRAY \\(+5:9\\)+ (BYTE|byte)"
gdb_test_exact "print bytetable2" \
{= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
gdb_test "ptype bytetable3" \
"type = ARRAY \\(1:2\\) ARRAY \\('c':'d'\\) ARRAY \\(FALSE:TRUE\\) (BYTE|byte)"
gdb_test_exact "print bytetable3" \
{= [(1): [('c'): [(FALSE): 0, (TRUE): 1], ('d'): [(FALSE): 2, (TRUE): 3]], (2): [('c'): [(FALSE): 4, (TRUE): 5], ('d'): [(FALSE): 6, (TRUE): 7]]]}
gdb_test "ptype bytetable4" \
"type = ARRAY \\(1:2\\) ARRAY \\('c':'d'\\) ARRAY \\(FALSE:TRUE\\) (BYTE|byte)"
gdb_test_exact "print bytetable4" \
{= [(1): [('c'): [(FALSE): 0, (TRUE): 1], ('d'): [(FALSE): 2, (TRUE): 3]], (2): [('c'): [(FALSE): 4, (TRUE): 5], ('d'): [(FALSE): 6, (TRUE): 7]]]}
gdb_test "ptype ubytetable1" "type = ARRAY \\(+0:4\\)+ (UBYTE|ubyte)"
gdb_test_exact "print ubytetable1" \
{= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
gdb_test "ptype ubytetable2" "type = ARRAY \\(+5:9\\)+ (UBYTE|ubyte)"
gdb_test_exact "print ubytetable2" \
{= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
gdb_test "ptype inttable1" "type = ARRAY \\(+0:4\\)+ (INT|int)"
gdb_test_exact "print inttable1" \
{= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
gdb_test "ptype inttable2" "type = ARRAY \\(+5:9\\)+ (INT|int)"
gdb_test_exact "print inttable2" \
{= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
gdb_test "ptype uinttable1" "type = ARRAY \\(+0:4\\)+ (UINT|uint)"
gdb_test_exact "print uinttable1" \
{= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
gdb_test "ptype uinttable2" "type = ARRAY \\(+5:9\\)+ (UINT|uint)"
gdb_test_exact "print uinttable2" \
{= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
gdb_test "ptype longtable1" "type = ARRAY \\(+0:4\\)+ (LONG|long)"
gdb_test_exact "print longtable1" \
{= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
gdb_test "ptype longtable2" "type = ARRAY \\(+5:9\\)+ (LONG|long)"
gdb_test_exact "print longtable2" \
{= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
gdb_test "ptype ulongtable1" "type = ARRAY \\(+0:4\\)+ (ULONG|ulong)"
gdb_test_exact "print ulongtable1" \
{= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
gdb_test "ptype ulongtable2" "type = ARRAY \\(+5:9\\)+ (ULONG|ulong)"
gdb_test_exact "print ulongtable2" \
{= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
gdb_test "ptype realtable1" "type = ARRAY \\(+0:4\\)+ (FLOAT|float)"
gdb_test_exact "print realtable1" \
{= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
gdb_test "ptype realtable2" "type = ARRAY \\(+5:9\\)+ (FLOAT|float)"
gdb_test_exact "print realtable2" \
{= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
gdb_test "ptype longrealtable1" "type = ARRAY \\(+0:4\\)+ (DOUBLE|double)"
gdb_test_exact "print longrealtable1" \
{= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
gdb_test "ptype longrealtable2" "type = ARRAY \\(+5:9\\)+ (DOUBLE|double)"
gdb_test_exact "print longrealtable2" \
{= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
gdb_test "print length(longrealtable2)" {= 5}
gdb_test "print lower(longrealtable2)" {= 5}
gdb_test "print upper(longrealtable2)" {= 9}
}
proc test_strings {} {
gdb_test "ptype string1" "type = CHARS \[(\]4\[)\]+"
gdb_test "print string1" " = \"abcd\""
gdb_test "ptype string2" "type = CHARS \[(\]+5\[)\]+"
gdb_test "print string2" { = \"ef\^\(0\)gh\"}
gdb_test "ptype string3" "type = CHARS \[(\]+6\[)\]+"
gdb_test "print string3" " = \"efghij\""
gdb_test "ptype string4" "type = CHARS \[(\]+7\[)\]+"
gdb_test "print string4" { = \"zzzzzz\^\(0\)\"}
# These tests require a running process, so run to one of the procs
# and then do the tests.
if [runto scalar_arithmetic] then {
gdb_test "ptype string1//string2" "type = CHARS \\(9\\)"
gdb_test "print string1//string2" { = \"abcdef\^\(0\)gh\"}
gdb_test_exact {ptype "a chill string"} {type = CHARS (14)}
gdb_test "print 'a chill string'" " = \"a chill string\""
gdb_test "print \"ef\"//c'00'//\"gh\"" { = \"ef\^\(0\)gh\"}
gdb_test "print string1 // \"efgh\"" " = \"abcdefgh\""
gdb_test "print (6) 'z'" " = \"zzzzzz\""
gdb_test "ptype (6) 'z'" "type = CHARS \[(\]+6\[)\]+"
gdb_test "print (1+2*3) 'x'" " = \"xxxxxxx\""
gdb_test "ptype (1+2*3) 'x'" "type = CHARS \[(\]+7\[)\]+"
}
}
proc test_structs {} {
gdb_test "ptype struct1" \
"type = STRUCT \\(+.*abool (BOOL|bool),.*aint (INT|int),.*astring CHARS \\(+8\\)+.*\\)+"
gdb_test "print struct1" \
".* = \\\[\.abool: TRUE, \.aint: 123, \.astring: \"a string\"\\\]"
gdb_test "ptype struct2" \
"type = STRUCT \\(+.*abool (BOOL|bool),.*nstruct simple_struct,.*aint (INT|int).*\\)+"
gdb_test "print struct2" \
".* = \\\[.abool: TRUE, \.nstruct: \\\[\.abool: FALSE, \.aint: 456, \.astring: \"deadbeef\"\\\], \.aint: 789\\\]"
}
proc test_ptr {} {
# This is to test Cygnus PR 6932
gdb_test "print xptr->int" ".* = 32767"
}
do_tests
# OBSOLETE # Copyright 1992, 1994, 1995, 1996 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 was written by Fred Fish. (fnf@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "chillvars"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE # This is needed (at least on SunOS4) to make sure the
# OBSOLETE # the symbol table is read.
# OBSOLETE gdb_test "break chillvars.ch:3" ""
# OBSOLETE gdb_test "delete 1" ""
# OBSOLETE
# OBSOLETE gdb_test "set width 0" ""
# OBSOLETE gdb_test "set print sevenbit-strings" ""
# OBSOLETE gdb_test "set print address off" ""
# OBSOLETE
# OBSOLETE test_BOOL
# OBSOLETE test_CHAR
# OBSOLETE test_BYTE
# OBSOLETE test_UBYTE
# OBSOLETE test_INT
# OBSOLETE test_UINT
# OBSOLETE test_LONG
# OBSOLETE test_ULONG
# OBSOLETE test_REAL
# OBSOLETE test_LONG_REAL
# OBSOLETE test_POWERSET
# OBSOLETE test_arrays
# OBSOLETE test_strings
# OBSOLETE test_structs
# OBSOLETE
# OBSOLETE test_ptr
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_BOOL {} {
# OBSOLETE
# OBSOLETE gdb_test "ptype bool_true" "type = (BOOL|bool)"
# OBSOLETE gdb_test "ptype bool_false" "type = (BOOL|bool)"
# OBSOLETE gdb_test "whatis bool_true" "type = (BOOL|bool)"
# OBSOLETE gdb_test "whatis bool_false" "type = (BOOL|bool)"
# OBSOLETE gdb_test "print bool_false" " = FALSE"
# OBSOLETE gdb_test "print bool_true" " = TRUE"
# OBSOLETE
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_CHAR {} {
# OBSOLETE gdb_test "ptype control_char" "type = (CHAR|char)"
# OBSOLETE gdb_test "whatis control_char" "type = (CHAR|char)"
# OBSOLETE gdb_test "print control_char" { = '\^[(]7[)]'}
# OBSOLETE gdb_test "ptype printable_char" "type = (CHAR|char)"
# OBSOLETE gdb_test "whatis printable_char" "type = (CHAR|char)"
# OBSOLETE gdb_test "print printable_char" " = 'a'"
# OBSOLETE
# OBSOLETE gdb_test "print lower(char)" { = '\^[(]0[)]'}
# OBSOLETE gdb_test "print upper(char)" { = '\^[(]255[)]'}
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_BYTE {} {
# OBSOLETE gdb_test "ptype byte_low" "type = (BYTE|byte)"
# OBSOLETE gdb_test "whatis byte_low" "type = (BYTE|byte)"
# OBSOLETE gdb_test "print byte_low" " = -128"
# OBSOLETE gdb_test "ptype byte_high" "type = (BYTE|byte)"
# OBSOLETE gdb_test "whatis byte_high" "type = (BYTE|byte)"
# OBSOLETE gdb_test "print byte_high" " = 127"
# OBSOLETE
# OBSOLETE gdb_test "print lower(byte)" " = -128"
# OBSOLETE gdb_test "print upper(byte)" " = 127"
# OBSOLETE gdb_test "print lower(byte_high)" " = -128"
# OBSOLETE gdb_test "print upper(byte_high)" " = 127"
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_UBYTE {} {
# OBSOLETE gdb_test "ptype ubyte_low" "type = (UBYTE|ubyte)"
# OBSOLETE gdb_test "whatis ubyte_low" "type = (UBYTE|ubyte)"
# OBSOLETE gdb_test "print ubyte_low" " = 0"
# OBSOLETE gdb_test "ptype ubyte_high" "type = (UBYTE|ubyte)"
# OBSOLETE gdb_test "whatis ubyte_high" "type = (UBYTE|ubyte)"
# OBSOLETE gdb_test "print ubyte_high" " = 255"
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_INT {} {
# OBSOLETE gdb_test "ptype int_low" "type = (INT|int)"
# OBSOLETE gdb_test "whatis int_low" "type = (INT|int)"
# OBSOLETE gdb_test "print int_low" " = -32768"
# OBSOLETE gdb_test "ptype int_high" "type = (INT|int)"
# OBSOLETE gdb_test "whatis int_high" "type = (INT|int)"
# OBSOLETE gdb_test "print int_high" " = 32767"
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_UINT {} {
# OBSOLETE gdb_test "ptype uint_low" "type = (UINT|uint)"
# OBSOLETE gdb_test "whatis uint_low" "type = (UINT|uint)"
# OBSOLETE gdb_test "print uint_low" " = 0"
# OBSOLETE gdb_test "ptype uint_high" "type = (UINT|uint)"
# OBSOLETE gdb_test "whatis uint_high" "type = (UINT|uint)"
# OBSOLETE gdb_test "print uint_high" " = 65535"
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_LONG {} {
# OBSOLETE gdb_test "ptype long_low" "type = (LONG|long)"
# OBSOLETE gdb_test "whatis long_low" "type = (LONG|long)"
# OBSOLETE gdb_test "print long_low" " = -2147483648"
# OBSOLETE gdb_test "ptype long_high" "type = (LONG|long)"
# OBSOLETE gdb_test "whatis long_high" "type = (LONG|long)"
# OBSOLETE gdb_test "print long_high" " = 2147483647"
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_ULONG {} {
# OBSOLETE gdb_test "ptype ulong_low" "type = (ULONG|ulong)"
# OBSOLETE gdb_test "whatis ulong_low" "type = (ULONG|ulong)"
# OBSOLETE gdb_test "print ulong_low" " = 0"
# OBSOLETE gdb_test "ptype ulong_high" "type = (ULONG|ulong)"
# OBSOLETE gdb_test "whatis ulong_high" "type = (ULONG|ulong)"
# OBSOLETE gdb_test "print ulong_high" " = 4294967295"
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_REAL {} {
# OBSOLETE gdb_test "ptype real1" "type = (FLOAT|float)"
# OBSOLETE gdb_test "whatis real1" "type = (FLOAT|float)"
# OBSOLETE gdb_test "print real1" " = 3.14159274"
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_LONG_REAL {} {
# OBSOLETE gdb_test "ptype long_real1" "type = (DOUBLE|double)"
# OBSOLETE gdb_test "whatis long_real1" "type = (DOUBLE|double)"
# OBSOLETE gdb_test "print long_real1" " = 3\\.1400000000000001e\\+300"
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_POWERSET {} {
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_arrays {} {
# OBSOLETE gdb_test "ptype booltable1" "type = ARRAY \\(+0:3\\)+ (BOOL|bool)"
# OBSOLETE gdb_test_exact "print booltable1" \
# OBSOLETE { = [(0): TRUE, (1:2): FALSE, (3): TRUE]}
# OBSOLETE
# OBSOLETE gdb_test "ptype booltable2" "type = ARRAY \\(+4:7\\)+ (BOOL|bool)"
# OBSOLETE gdb_test_exact "print booltable2" { = [(4): TRUE, (5:6): FALSE, (7): TRUE]}
# OBSOLETE
# OBSOLETE gdb_test "ptype chartable1" "type = ARRAY \\(+0:2\\)+ (CHAR|char)"
# OBSOLETE gdb_test_exact "print chartable1" {= [(0): '^(0)', (1): '^(1)', (2): '^(2)']}
# OBSOLETE
# OBSOLETE gdb_test "ptype chartable2" "type = ARRAY \\(+3:5\\)+ (CHAR|char)"
# OBSOLETE gdb_test_exact "print chartable2" \
# OBSOLETE {= [(3): '^(0)', (4): '^(1)', (5): '^(2)']}
# OBSOLETE
# OBSOLETE gdb_test "ptype bytetable1" "type = ARRAY \\(+0:4\\)+ (BYTE|byte)"
# OBSOLETE gdb_test_exact "print bytetable1" \
# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
# OBSOLETE
# OBSOLETE gdb_test "ptype bytetable2" "type = ARRAY \\(+5:9\\)+ (BYTE|byte)"
# OBSOLETE gdb_test_exact "print bytetable2" \
# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
# OBSOLETE
# OBSOLETE gdb_test "ptype bytetable3" \
# OBSOLETE "type = ARRAY \\(1:2\\) ARRAY \\('c':'d'\\) ARRAY \\(FALSE:TRUE\\) (BYTE|byte)"
# OBSOLETE gdb_test_exact "print bytetable3" \
# OBSOLETE {= [(1): [('c'): [(FALSE): 0, (TRUE): 1], ('d'): [(FALSE): 2, (TRUE): 3]], (2): [('c'): [(FALSE): 4, (TRUE): 5], ('d'): [(FALSE): 6, (TRUE): 7]]]}
# OBSOLETE gdb_test "ptype bytetable4" \
# OBSOLETE "type = ARRAY \\(1:2\\) ARRAY \\('c':'d'\\) ARRAY \\(FALSE:TRUE\\) (BYTE|byte)"
# OBSOLETE gdb_test_exact "print bytetable4" \
# OBSOLETE {= [(1): [('c'): [(FALSE): 0, (TRUE): 1], ('d'): [(FALSE): 2, (TRUE): 3]], (2): [('c'): [(FALSE): 4, (TRUE): 5], ('d'): [(FALSE): 6, (TRUE): 7]]]}
# OBSOLETE
# OBSOLETE gdb_test "ptype ubytetable1" "type = ARRAY \\(+0:4\\)+ (UBYTE|ubyte)"
# OBSOLETE gdb_test_exact "print ubytetable1" \
# OBSOLETE {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
# OBSOLETE
# OBSOLETE gdb_test "ptype ubytetable2" "type = ARRAY \\(+5:9\\)+ (UBYTE|ubyte)"
# OBSOLETE gdb_test_exact "print ubytetable2" \
# OBSOLETE {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
# OBSOLETE
# OBSOLETE gdb_test "ptype inttable1" "type = ARRAY \\(+0:4\\)+ (INT|int)"
# OBSOLETE gdb_test_exact "print inttable1" \
# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
# OBSOLETE
# OBSOLETE gdb_test "ptype inttable2" "type = ARRAY \\(+5:9\\)+ (INT|int)"
# OBSOLETE gdb_test_exact "print inttable2" \
# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
# OBSOLETE
# OBSOLETE gdb_test "ptype uinttable1" "type = ARRAY \\(+0:4\\)+ (UINT|uint)"
# OBSOLETE gdb_test_exact "print uinttable1" \
# OBSOLETE {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
# OBSOLETE
# OBSOLETE gdb_test "ptype uinttable2" "type = ARRAY \\(+5:9\\)+ (UINT|uint)"
# OBSOLETE gdb_test_exact "print uinttable2" \
# OBSOLETE {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
# OBSOLETE
# OBSOLETE gdb_test "ptype longtable1" "type = ARRAY \\(+0:4\\)+ (LONG|long)"
# OBSOLETE gdb_test_exact "print longtable1" \
# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
# OBSOLETE
# OBSOLETE gdb_test "ptype longtable2" "type = ARRAY \\(+5:9\\)+ (LONG|long)"
# OBSOLETE gdb_test_exact "print longtable2" \
# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
# OBSOLETE
# OBSOLETE gdb_test "ptype ulongtable1" "type = ARRAY \\(+0:4\\)+ (ULONG|ulong)"
# OBSOLETE gdb_test_exact "print ulongtable1" \
# OBSOLETE {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
# OBSOLETE
# OBSOLETE gdb_test "ptype ulongtable2" "type = ARRAY \\(+5:9\\)+ (ULONG|ulong)"
# OBSOLETE gdb_test_exact "print ulongtable2" \
# OBSOLETE {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
# OBSOLETE
# OBSOLETE gdb_test "ptype realtable1" "type = ARRAY \\(+0:4\\)+ (FLOAT|float)"
# OBSOLETE gdb_test_exact "print realtable1" \
# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
# OBSOLETE
# OBSOLETE gdb_test "ptype realtable2" "type = ARRAY \\(+5:9\\)+ (FLOAT|float)"
# OBSOLETE gdb_test_exact "print realtable2" \
# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
# OBSOLETE
# OBSOLETE gdb_test "ptype longrealtable1" "type = ARRAY \\(+0:4\\)+ (DOUBLE|double)"
# OBSOLETE gdb_test_exact "print longrealtable1" \
# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
# OBSOLETE
# OBSOLETE gdb_test "ptype longrealtable2" "type = ARRAY \\(+5:9\\)+ (DOUBLE|double)"
# OBSOLETE gdb_test_exact "print longrealtable2" \
# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
# OBSOLETE
# OBSOLETE gdb_test "print length(longrealtable2)" {= 5}
# OBSOLETE gdb_test "print lower(longrealtable2)" {= 5}
# OBSOLETE gdb_test "print upper(longrealtable2)" {= 9}
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_strings {} {
# OBSOLETE
# OBSOLETE gdb_test "ptype string1" "type = CHARS \[(\]4\[)\]+"
# OBSOLETE gdb_test "print string1" " = \"abcd\""
# OBSOLETE
# OBSOLETE gdb_test "ptype string2" "type = CHARS \[(\]+5\[)\]+"
# OBSOLETE gdb_test "print string2" { = \"ef\^\(0\)gh\"}
# OBSOLETE
# OBSOLETE gdb_test "ptype string3" "type = CHARS \[(\]+6\[)\]+"
# OBSOLETE gdb_test "print string3" " = \"efghij\""
# OBSOLETE
# OBSOLETE gdb_test "ptype string4" "type = CHARS \[(\]+7\[)\]+"
# OBSOLETE gdb_test "print string4" { = \"zzzzzz\^\(0\)\"}
# OBSOLETE
# OBSOLETE # These tests require a running process, so run to one of the procs
# OBSOLETE # and then do the tests.
# OBSOLETE
# OBSOLETE if [runto scalar_arithmetic] then {
# OBSOLETE gdb_test "ptype string1//string2" "type = CHARS \\(9\\)"
# OBSOLETE gdb_test "print string1//string2" { = \"abcdef\^\(0\)gh\"}
# OBSOLETE gdb_test_exact {ptype "a chill string"} {type = CHARS (14)}
# OBSOLETE gdb_test "print 'a chill string'" " = \"a chill string\""
# OBSOLETE gdb_test "print \"ef\"//c'00'//\"gh\"" { = \"ef\^\(0\)gh\"}
# OBSOLETE gdb_test "print string1 // \"efgh\"" " = \"abcdefgh\""
# OBSOLETE gdb_test "print (6) 'z'" " = \"zzzzzz\""
# OBSOLETE gdb_test "ptype (6) 'z'" "type = CHARS \[(\]+6\[)\]+"
# OBSOLETE gdb_test "print (1+2*3) 'x'" " = \"xxxxxxx\""
# OBSOLETE gdb_test "ptype (1+2*3) 'x'" "type = CHARS \[(\]+7\[)\]+"
# OBSOLETE }
# OBSOLETE
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_structs {} {
# OBSOLETE gdb_test "ptype struct1" \
# OBSOLETE "type = STRUCT \\(+.*abool (BOOL|bool),.*aint (INT|int),.*astring CHARS \\(+8\\)+.*\\)+"
# OBSOLETE gdb_test "print struct1" \
# OBSOLETE ".* = \\\[\.abool: TRUE, \.aint: 123, \.astring: \"a string\"\\\]"
# OBSOLETE gdb_test "ptype struct2" \
# OBSOLETE "type = STRUCT \\(+.*abool (BOOL|bool),.*nstruct simple_struct,.*aint (INT|int).*\\)+"
# OBSOLETE gdb_test "print struct2" \
# OBSOLETE ".* = \\\[.abool: TRUE, \.nstruct: \\\[\.abool: FALSE, \.aint: 456, \.astring: \"deadbeef\"\\\], \.aint: 789\\\]"
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_ptr {} {
# OBSOLETE # This is to test Cygnus PR 6932
# OBSOLETE gdb_test "print xptr->int" ".* = 32767"
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,85 +1,85 @@
# 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 was written by Wilfried Moser (moser@aut.alcatel.at
#
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "enum"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -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 }
}
return [gdb_test "show language" ".* source language is \"chill\".*" \
"set language to \"chill\""]
}
set prms_id 0
set bug_id 0
# 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 {
runto hugo_
send_gdb "set var \$i := d\n"
gdb_expect -re ".*$gdb_prompt $"
gdb_test "print \$i" { = d}
gdb_test "print size (\$i)" { = 1}
gdb_test "print b+c" { = 3}
gdb_test "print c*d" { = 6}
gdb_test "print a<b" { = TRUE}
gdb_test "print a=b" { = FALSE}
gdb_test "print a=a" { = TRUE}
gdb_test "print a/=\$i" { = TRUE}
# This is PR 8870
gdb_test "break malloc" ".*"
gdb_test {set var $j := m_set[b]} ".*invalid.*tuple.*"
}
# 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 was written by Wilfried Moser (moser@aut.alcatel.at
# OBSOLETE #
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "enum"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -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
# 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 return [gdb_test "show language" ".* source language is \"chill\".*" \
# OBSOLETE "set language to \"chill\""]
# OBSOLETE }
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# 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 runto hugo_
# OBSOLETE
# OBSOLETE send_gdb "set var \$i := d\n"
# OBSOLETE gdb_expect -re ".*$gdb_prompt $"
# OBSOLETE gdb_test "print \$i" { = d}
# OBSOLETE gdb_test "print size (\$i)" { = 1}
# OBSOLETE gdb_test "print b+c" { = 3}
# OBSOLETE gdb_test "print c*d" { = 6}
# OBSOLETE gdb_test "print a<b" { = TRUE}
# OBSOLETE gdb_test "print a=b" { = FALSE}
# OBSOLETE gdb_test "print a=a" { = TRUE}
# OBSOLETE gdb_test "print a/=\$i" { = TRUE}
# OBSOLETE
# OBSOLETE # This is PR 8870
# OBSOLETE gdb_test "break malloc" ".*"
# OBSOLETE gdb_test {set var $j := m_set[b]} ".*invalid.*tuple.*"
# OBSOLETE }

View File

@ -1,76 +1,76 @@
# 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 was written by Fred Fish. (fnf@cygnus.com)
# Martin Pottendorfer (pottendo@aut.alcatel.at)
#
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "gch1041"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -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 }
}
return [gdb_test "show language" ".* source language is \"chill\".*" \
"set language to \"chill\""]
}
set prms_id 0
set bug_id 0
# 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 {
runto arr_
# check if array slices print correct index
gdb_test {print a1(10:30)} { = \[\(10:30\): 33\]}
gdb_test {print a2(3:5)} { = \[\(3:5\): \[.l: 22, .c: "mowi", .b: TRUE\]\]}
gdb_test {print a3('a':'c')} { = \[\('a':'c'\): 'X'\]}
gdb_test {print a4(e2:e5)} { = \[\(e2:e5\): TRUE\]}
}
# 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 was written by Fred Fish. (fnf@cygnus.com)
# OBSOLETE # Martin Pottendorfer (pottendo@aut.alcatel.at)
# OBSOLETE #
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "gch1041"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -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
# 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 return [gdb_test "show language" ".* source language is \"chill\".*" \
# OBSOLETE "set language to \"chill\""]
# OBSOLETE }
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# 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 runto arr_
# OBSOLETE # check if array slices print correct index
# OBSOLETE gdb_test {print a1(10:30)} { = \[\(10:30\): 33\]}
# OBSOLETE gdb_test {print a2(3:5)} { = \[\(3:5\): \[.l: 22, .c: "mowi", .b: TRUE\]\]}
# OBSOLETE gdb_test {print a3('a':'c')} { = \[\('a':'c'\): 'X'\]}
# OBSOLETE gdb_test {print a4(e2:e5)} { = \[\(e2:e5\): TRUE\]}
# OBSOLETE }

View File

@ -1,86 +1,86 @@
# 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 was written by Wilfried Moser (moser@aut.alcatel.at)
#
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "gch1272"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -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 }
}
return [gdb_test "show language" ".* source language is \"chill\".*" \
"set language to \"chill\""]
}
set prms_id 0
set bug_id 0
# 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 {
runto brrr
# check foo
gdb_test {print foo} { = \[\(0:99\): 222\]}
gdb_test "set var foo := m_array\[\(\*\):44\]" ".*"
gdb_test {print foo} { = \[\(0:99\): 44\]}
# check bar
gdb_test {print bar} { = \[\(-10:20\): \[.i: 0, .b: FALSE\]\]}
gdb_test "set var bar := m_bar\[\(\*\): \[42, TRUE\]\]" ".*"
gdb_test {print bar} { = \[\(-10:20\): \[.i: 42, .b: TRUE\]\]}
# some failues
gdb_test "set var foo := \[\(\*\):44\]" {\(\*\) only possible with modename in front of tuple \(mode\[\.\.\]\)}
gdb_test "set var foo := m_xxx\[\(\*\):44\]" {Invalid cast\.}
gdb_test "set var foo := m_struct\[\(\*\):44\]" {\(\*\) in invalid context}
gdb_test "set var foo := m_ps\[\(\*\):44\]" {\(\*\) in invalid context}
}
# 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 was written by Wilfried Moser (moser@aut.alcatel.at)
# OBSOLETE #
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "gch1272"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -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
# 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 return [gdb_test "show language" ".* source language is \"chill\".*" \
# OBSOLETE "set language to \"chill\""]
# OBSOLETE }
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# 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 runto brrr
# OBSOLETE
# OBSOLETE # check foo
# OBSOLETE gdb_test {print foo} { = \[\(0:99\): 222\]}
# OBSOLETE gdb_test "set var foo := m_array\[\(\*\):44\]" ".*"
# OBSOLETE gdb_test {print foo} { = \[\(0:99\): 44\]}
# OBSOLETE
# OBSOLETE # check bar
# OBSOLETE gdb_test {print bar} { = \[\(-10:20\): \[.i: 0, .b: FALSE\]\]}
# OBSOLETE gdb_test "set var bar := m_bar\[\(\*\): \[42, TRUE\]\]" ".*"
# OBSOLETE gdb_test {print bar} { = \[\(-10:20\): \[.i: 42, .b: TRUE\]\]}
# OBSOLETE
# OBSOLETE # some failues
# OBSOLETE gdb_test "set var foo := \[\(\*\):44\]" {\(\*\) only possible with modename in front of tuple \(mode\[\.\.\]\)}
# OBSOLETE gdb_test "set var foo := m_xxx\[\(\*\):44\]" {Invalid cast\.}
# OBSOLETE gdb_test "set var foo := m_struct\[\(\*\):44\]" {\(\*\) in invalid context}
# OBSOLETE gdb_test "set var foo := m_ps\[\(\*\):44\]" {\(\*\) in invalid context}
# OBSOLETE }

View File

@ -1,76 +1,76 @@
# 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 was written by Wilfried Moser (moser@aut.alcatel.at)
#
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "gch1280"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -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 }
}
return [gdb_test "show language" ".* source language is \"chill\".*" \
"set language to \"chill\""]
}
set prms_id 0
set bug_id 0
# 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 {
runto doit
gdb_test "next" ""
# check too many array elements
gdb_test {set var v_x := [1,2,3,4,5]} {Too many array elements}
gdb_test {set var $i := m_x[(3): 22, 25]} {Too many array elements}
gdb_test "set var \$i := m_x\[\(2\): 22, 25\]" ""
gdb_test {print $i} { = \[\(1\): 0, \(2\): 22, \(3\): 25\]}
}
# 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 was written by Wilfried Moser (moser@aut.alcatel.at)
# OBSOLETE #
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "gch1280"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -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
# 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 return [gdb_test "show language" ".* source language is \"chill\".*" \
# OBSOLETE "set language to \"chill\""]
# OBSOLETE }
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# 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 runto doit
# OBSOLETE gdb_test "next" ""
# OBSOLETE # check too many array elements
# OBSOLETE gdb_test {set var v_x := [1,2,3,4,5]} {Too many array elements}
# OBSOLETE gdb_test {set var $i := m_x[(3): 22, 25]} {Too many array elements}
# OBSOLETE gdb_test "set var \$i := m_x\[\(2\): 22, 25\]" ""
# OBSOLETE gdb_test {print $i} { = \[\(1\): 0, \(2\): 22, \(3\): 25\]}
# OBSOLETE }

View File

@ -1,183 +1,183 @@
# 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.
# This file was written by Wilfried Moser (moser@aut.alcatel.at)
# Kurt Fuchs (fuchs_k@aut.alcatel.at)
#
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "gch922"
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_chars {} {
global passcount gdb_prompt
verbose "Testing Chars"
set passcount 0
test_print_accept "print a" {'\^\(0\)'<repeats 70 times>//"Jason""\^\(0,5\)""Hugo\^\(10\)"//'\^\(1\)'<repeats 70 times>}
test_print_accept "print b" {"Jason""\^\(0,5\)""Hugo\^\(10\)"}
test_print_accept "print c" {'a'<repeats 70 times>//"\^\(0,5\)Jason"//'b'<repeats 70 times>}
test_print_accept "print d" {'\^\(11\)'}
gdb_test "set var a := (100)'\^(0,255)'" ""
test_print_accept "print a" {"\^\(0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255\)"}
send_gdb "set var a := (10)'\^(1)'//(26)\"\^(66,67)\"//\" \"//'I'//' '//'a'//'m'//\" Hugo\" \n" ; gdb_expect -re "$gdb_prompt $"
test_print_accept "print a" {"\^\(1,1,1,1,1,1,1,1,1,1\)BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC I am Hugo"}
send_gdb "set var b := \"Hugo \"\"\^(3,4)\"\"Otto\^(17)\" \n" ; gdb_expect -re "$gdb_prompt $"
test_print_accept "print b" {"Hugo ""\^\(3,4\)""Otto\^\(17\)"}
send_gdb "set var c := (70)'b' // \"\^(2,3)Hugo \" // (70)'c' \n" ; gdb_expect -re "$gdb_prompt $"
test_print_accept "print c" {'b'<repeats 70 times>//"\^\(2,3\)Hugo "//'c'<repeats 70 times>}
gdb_test "set var d := '\^(199)'" ""
test_print_accept "print d" {'\^\(199\)'}
test_print_accept "print (10)'\^(0)'//(26)\"\^(66,67)\"//\" \"//'I'//' '//'a'//'m'//\" Hugo\"" {"\^\(0,0,0,0,0,0,0,0,0,0\)BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC I am Hugo"}
test_print_accept "print \"Jason\"\"\^(0,5)\"\"Hugo\^(10)\"" {"Jason""\^\(0,5\)""Hugo\^\(10\)"}
send_gdb "set var a := \"\" \n" ; gdb_expect -re "$gdb_prompt $"
test_print_accept "print a" {""}
send_gdb "set var a := \"\"\"\" \n" ; gdb_expect -re "$gdb_prompt $"
test_print_accept "print a" {""""}
send_gdb "set var a := \" \"\"\" \n" ; gdb_expect -re "$gdb_prompt $"
test_print_accept "print a" {" """}
send_gdb "set var a := \"\^\^\" \n" ; gdb_expect -re "$gdb_prompt $"
test_print_accept "print a" {"\^\^"}
send_gdb "set var a := \"'\" \n" ; gdb_expect -re "$gdb_prompt $"
test_print_accept "print a" {"'"}
}
proc test_code {} {
global passcount gdb_prompt
verbose "Testing Chars"
set passcount 0
runto bulk
test_print_accept "print a" {"\^\(255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127\)"}
test_print_accept "print b" {"\^\(200\)"}
# test_print_accept "print c" {'a'<repeats 70 times>//"\^\(0,5\)Jason"//'b'<repeats 70 times>}
test_print_accept "print d" {'a'}
}
# 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_chars
# test_code
} 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 # This file was written by Wilfried Moser (moser@aut.alcatel.at)
# OBSOLETE # Kurt Fuchs (fuchs_k@aut.alcatel.at)
# OBSOLETE #
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "gch922"
# 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
# OBSOLETE proc test_chars {} {
# OBSOLETE global passcount gdb_prompt
# OBSOLETE
# OBSOLETE verbose "Testing Chars"
# OBSOLETE set passcount 0
# OBSOLETE
# OBSOLETE test_print_accept "print a" {'\^\(0\)'<repeats 70 times>//"Jason""\^\(0,5\)""Hugo\^\(10\)"//'\^\(1\)'<repeats 70 times>}
# OBSOLETE test_print_accept "print b" {"Jason""\^\(0,5\)""Hugo\^\(10\)"}
# OBSOLETE test_print_accept "print c" {'a'<repeats 70 times>//"\^\(0,5\)Jason"//'b'<repeats 70 times>}
# OBSOLETE test_print_accept "print d" {'\^\(11\)'}
# OBSOLETE
# OBSOLETE gdb_test "set var a := (100)'\^(0,255)'" ""
# OBSOLETE test_print_accept "print a" {"\^\(0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255\)"}
# OBSOLETE
# OBSOLETE send_gdb "set var a := (10)'\^(1)'//(26)\"\^(66,67)\"//\" \"//'I'//' '//'a'//'m'//\" Hugo\" \n" ; gdb_expect -re "$gdb_prompt $"
# OBSOLETE test_print_accept "print a" {"\^\(1,1,1,1,1,1,1,1,1,1\)BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC I am Hugo"}
# OBSOLETE send_gdb "set var b := \"Hugo \"\"\^(3,4)\"\"Otto\^(17)\" \n" ; gdb_expect -re "$gdb_prompt $"
# OBSOLETE test_print_accept "print b" {"Hugo ""\^\(3,4\)""Otto\^\(17\)"}
# OBSOLETE send_gdb "set var c := (70)'b' // \"\^(2,3)Hugo \" // (70)'c' \n" ; gdb_expect -re "$gdb_prompt $"
# OBSOLETE test_print_accept "print c" {'b'<repeats 70 times>//"\^\(2,3\)Hugo "//'c'<repeats 70 times>}
# OBSOLETE gdb_test "set var d := '\^(199)'" ""
# OBSOLETE test_print_accept "print d" {'\^\(199\)'}
# OBSOLETE
# OBSOLETE test_print_accept "print (10)'\^(0)'//(26)\"\^(66,67)\"//\" \"//'I'//' '//'a'//'m'//\" Hugo\"" {"\^\(0,0,0,0,0,0,0,0,0,0\)BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC I am Hugo"}
# OBSOLETE test_print_accept "print \"Jason\"\"\^(0,5)\"\"Hugo\^(10)\"" {"Jason""\^\(0,5\)""Hugo\^\(10\)"}
# OBSOLETE
# OBSOLETE send_gdb "set var a := \"\" \n" ; gdb_expect -re "$gdb_prompt $"
# OBSOLETE test_print_accept "print a" {""}
# OBSOLETE send_gdb "set var a := \"\"\"\" \n" ; gdb_expect -re "$gdb_prompt $"
# OBSOLETE test_print_accept "print a" {""""}
# OBSOLETE send_gdb "set var a := \" \"\"\" \n" ; gdb_expect -re "$gdb_prompt $"
# OBSOLETE test_print_accept "print a" {" """}
# OBSOLETE send_gdb "set var a := \"\^\^\" \n" ; gdb_expect -re "$gdb_prompt $"
# OBSOLETE test_print_accept "print a" {"\^\^"}
# OBSOLETE send_gdb "set var a := \"'\" \n" ; gdb_expect -re "$gdb_prompt $"
# OBSOLETE test_print_accept "print a" {"'"}
# OBSOLETE }
# OBSOLETE
# OBSOLETE
# OBSOLETE proc test_code {} {
# OBSOLETE global passcount gdb_prompt
# OBSOLETE
# OBSOLETE verbose "Testing Chars"
# OBSOLETE set passcount 0
# OBSOLETE
# OBSOLETE runto bulk
# OBSOLETE test_print_accept "print a" {"\^\(255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127\)"}
# OBSOLETE test_print_accept "print b" {"\^\(200\)"}
# OBSOLETE # test_print_accept "print c" {'a'<repeats 70 times>//"\^\(0,5\)Jason"//'b'<repeats 70 times>}
# OBSOLETE test_print_accept "print d" {'a'}
# OBSOLETE }
# 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
# OBSOLETE if [set_lang_chill] then {
# OBSOLETE # test builtins as described in chapter 6.20.3 Z.200
# OBSOLETE
# OBSOLETE test_chars
# OBSOLETE # test_code
# OBSOLETE } else {
# OBSOLETE warning "$test_name tests suppressed."
# OBSOLETE }

View File

@ -1,249 +1,249 @@
# 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.
# This file was written by Wilfried Moser (moser@aut.alcatel.at)
# Kurt Fuchs (fuchs_k@aut.alcatel.at)
#
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "gch981"
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_power {} {
global passcount gdb_prompt
verbose "Testing some POWERSET Stuff"
set passcount 0
test_print_accept "print v1_power1" {\[e1:e5\]}
test_print_accept "print v2_power1" {\[\]}
test_print_accept "print SIZE(v1_power1)" "1"
gdb_test "set v1_power1 := \[b1\]" ""
# if GDB has rejected the improper values, we have to gdb_expect the same!
test_print_accept "print v1_power1" {\[e1:e5\]}
gdb_test "set v1_power1 := \[a1,a2\]" ""
test_print_accept "print v1_power1" {\[e1:e5\]}
gdb_test "set v1_power1 := \[b1,b2,b3,e4\]" ""
test_print_accept "print v1_power1" {\[e1:e5\]}
gdb_test "set v1_power1 := \[e4:e5\]" ""
test_print_accept "print v1_power1" {\[e4:e5\]}
gdb_test "set v1_power1 := \[e1, e2:e3, e5\]" ""
test_print_accept "print v1_power1" {\[e1:e3, e5\]}
gdb_test "set v1_power1 := \[e1, e2:e4, e4:e5\]" ""
test_print_accept "print v1_power1" {\[e1:e5\]}
gdb_test "set v1_power1 := \[e1, e1:e3, e1:e2, e2:e3\]" ""
test_print_accept "print v1_power1" {\[e1:e3\]}
gdb_test "set v_power2 := \[e2\]" ""
test_print_accept "print v_power2" {\[\]}
gdb_test "set v_power2 := \[1,2,3\]" ""
test_print_accept "print v_power2" {\[\]}
gdb_test "set v_power2 := \[e2, b2, b1\]" ""
test_print_accept "print v_power2" {\[\]}
# Note, that this is a numbered SET, so a1:a3 contains all elements (exept a6)
gdb_test "set v_power2 := \[a1:a3, a6:a4, a7:a9\]" ""
test_print_accept "print v_power2" {\[a6:a3\]}
gdb_test "set v_power2 := \[a1, a4:a6, a9\]" ""
test_print_accept "print v_power2" {\[a1, a9\]}
gdb_test "set v_power2 := \[a1:a2, a6, a9\]" ""
test_print_accept "print v_power2" {\[a6:a2, a9\]}
gdb_test "set v_power2 := \[a1, a4, a7:a8, a9:a3\]" ""
test_print_accept "print v_power2" {\[a1, a4, a9:a8\]}
gdb_test "set v_power2 := \[a1, a4:a8\]" ""
test_print_accept "print v_power2" {\[a1, a4:a8\]}
gdb_test "set v_power2 := \[a8,a3,a7,a9,a5,a6\]" ""
test_print_accept "print v_power2" {\[a6, a5, a9, a7, a3, a8\]}
gdb_test "set v_power3 := \[b1:b2,e1\]" ""
test_print_accept "print v_power3" {\[b1:b2\]}
gdb_test "set v_power3 := \[b1, b3, b6:b7\]" ""
test_print_accept "print v_power3" {\[b1, b3, b6:b7\]}
gdb_test "set v_power3 := \[b1, b3:b4, b7\]" ""
test_print_accept "print v_power3" {\[b1, b3:b4, b7\]}
gdb_test "set v_power3 := \[b1, b4:b6, b7\]" ""
test_print_accept "print v_power3" {\[b1, b4:b7\]}
gdb_test "set v_power3 := \[b1:b7\]" ""
test_print_accept "print v_power3" {\[b1:b7\]}
gdb_test "set v_power3 := \[b5:b7, b1\]" ""
test_print_accept "print v_power3" {\[b1, b5:b7\]}
gdb_test "set v_power4 := \[\"b\"\]" ""
test_print_accept "print v_power4" {\['b':'x'\]}
gdb_test "set v_power4 := \[5\]" ""
test_print_accept "print v_power4" {\['b':'x'\]}
gdb_test "set v_power4 := \['c':'f','g':'h','o':'t'\]" ""
test_print_accept "print v_power4" {\['c':'h', 'o':'t'\]}
gdb_test "set v_power4 := \['a','b','c','d','e','f'\]" ""
test_print_accept "print v_power4" {\['a':'f'\]}
gdb_test "set v_power4 := \['\^(0)':'\^(200)'\]" ""
test_print_accept "print v_power4" {\['\^\(0\)':'\^\(200\)'\]}
gdb_test "set v_power5 := \[a8\]" ""
test_print_accept "print v_power5" {\[2:100\]}
gdb_test "set v_power5 := \[4\]" ""
test_print_accept "print v_power5" {\[4\]}
gdb_test "set v_power5 := \[3:95,9:100,10:107,200:250\]" ""
test_print_accept "print v_power5" {\[3:107, 200:250\]}
gdb_test "set v_power5 := \[2, 100:120, 350:400\]" ""
test_print_accept "print v_power5" {\[2, 100:120, 350:400\]}
gdb_test "set v_power5 := \[2:64,65:127,128:256,256:399,400\]" ""
test_print_accept "print v_power5" {\[2:400\]}
gdb_test "set v_power5 := \[3:95, 99:100, 101:107, 200:250\]" ""
test_print_accept "print v_power5" {\[3:95, 99:107, 200:250\]}
gdb_test "set v_power6 := \[a8\]" ""
test_print_accept "print v_power6" {\[\]}
gdb_test "set v_power6 := \[4\]" ""
test_print_accept "print v_power6" {\[4\]}
gdb_test "set v_power6 := \[3:95, 99:100, 101:107, 200:250\]" ""
test_print_accept "print v_power6" {\[3:95, 99:107, 200:250\]}
gdb_test "set v_power6 := \[-111:0, 1:112, 11111:22222\]" ""
test_print_accept "print v_power6" {\[-111:112, 11111:22222\]}
gdb_test "set v_power6 := \[0, 200:4000, 6666:9999\]" ""
test_print_accept "print v_power6" {\[0, 200:4000, 6666:9999\]}
# gdb_test "set v_power7 := \[a8\]" ""
# test_print_accept "print v_power7" {\[2:100\]}
# gdb_test "set v_power7 := \[4\]" ""
# test_print_accept "print v_power7" {\[4\]}
# gdb_test "set v_power7 := \[3:95, 99:100, 101:107, 200:250\]" ""
# test_print_accept "print v_power7" {\[3:95, 99:107, 200:250\]}
# gdb_test "set v_power7 := \[0, 1000, 1000000, 10000000000\]" ""
# test_print_accept "print v_power7" {\[0, 1000, 1000000, 1000000000\]}
# gdb_test "set v_power7 := \[-20000:100000, 111111:2222222\]" ""
# test_print_accept "print v_power7" {\[-20000:100000, 111111:2222222\]}
# gdb_test "set v_power7 := \[\]" ""
# test_print_accept "print v_power7" {\[3:95, 99:107, 200:250\]}
# gdb_test "set v_power7 := \[2:-500, -501:1, 20:370, -888:-920, 1000:2000, 1800:2500\]\ " ""
# test_print_accept "print v_power7" {\[-920:-888, -501:2, 20:370, 1000:2500\]}
# test_print_accept "print SIZE(v_power7)" ""
runto 58
test_print_accept "print v_set1 IN v1_power1" "TRUE"
test_print_accept "print v_set1 IN v2_power1" "FALSE"
}
# 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_power
} 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 # This file was written by Wilfried Moser (moser@aut.alcatel.at)
# OBSOLETE # Kurt Fuchs (fuchs_k@aut.alcatel.at)
# OBSOLETE #
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "gch981"
# 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_power {} {
# OBSOLETE global passcount gdb_prompt
# OBSOLETE
# OBSOLETE verbose "Testing some POWERSET Stuff"
# OBSOLETE set passcount 0
# OBSOLETE
# OBSOLETE test_print_accept "print v1_power1" {\[e1:e5\]}
# OBSOLETE test_print_accept "print v2_power1" {\[\]}
# OBSOLETE test_print_accept "print SIZE(v1_power1)" "1"
# OBSOLETE
# OBSOLETE gdb_test "set v1_power1 := \[b1\]" ""
# OBSOLETE # if GDB has rejected the improper values, we have to gdb_expect the same!
# OBSOLETE test_print_accept "print v1_power1" {\[e1:e5\]}
# OBSOLETE
# OBSOLETE gdb_test "set v1_power1 := \[a1,a2\]" ""
# OBSOLETE test_print_accept "print v1_power1" {\[e1:e5\]}
# OBSOLETE gdb_test "set v1_power1 := \[b1,b2,b3,e4\]" ""
# OBSOLETE test_print_accept "print v1_power1" {\[e1:e5\]}
# OBSOLETE gdb_test "set v1_power1 := \[e4:e5\]" ""
# OBSOLETE test_print_accept "print v1_power1" {\[e4:e5\]}
# OBSOLETE gdb_test "set v1_power1 := \[e1, e2:e3, e5\]" ""
# OBSOLETE test_print_accept "print v1_power1" {\[e1:e3, e5\]}
# OBSOLETE gdb_test "set v1_power1 := \[e1, e2:e4, e4:e5\]" ""
# OBSOLETE test_print_accept "print v1_power1" {\[e1:e5\]}
# OBSOLETE gdb_test "set v1_power1 := \[e1, e1:e3, e1:e2, e2:e3\]" ""
# OBSOLETE test_print_accept "print v1_power1" {\[e1:e3\]}
# OBSOLETE
# OBSOLETE gdb_test "set v_power2 := \[e2\]" ""
# OBSOLETE test_print_accept "print v_power2" {\[\]}
# OBSOLETE gdb_test "set v_power2 := \[1,2,3\]" ""
# OBSOLETE test_print_accept "print v_power2" {\[\]}
# OBSOLETE gdb_test "set v_power2 := \[e2, b2, b1\]" ""
# OBSOLETE test_print_accept "print v_power2" {\[\]}
# OBSOLETE
# OBSOLETE # Note, that this is a numbered SET, so a1:a3 contains all elements (exept a6)
# OBSOLETE gdb_test "set v_power2 := \[a1:a3, a6:a4, a7:a9\]" ""
# OBSOLETE test_print_accept "print v_power2" {\[a6:a3\]}
# OBSOLETE gdb_test "set v_power2 := \[a1, a4:a6, a9\]" ""
# OBSOLETE test_print_accept "print v_power2" {\[a1, a9\]}
# OBSOLETE gdb_test "set v_power2 := \[a1:a2, a6, a9\]" ""
# OBSOLETE test_print_accept "print v_power2" {\[a6:a2, a9\]}
# OBSOLETE gdb_test "set v_power2 := \[a1, a4, a7:a8, a9:a3\]" ""
# OBSOLETE test_print_accept "print v_power2" {\[a1, a4, a9:a8\]}
# OBSOLETE gdb_test "set v_power2 := \[a1, a4:a8\]" ""
# OBSOLETE test_print_accept "print v_power2" {\[a1, a4:a8\]}
# OBSOLETE gdb_test "set v_power2 := \[a8,a3,a7,a9,a5,a6\]" ""
# OBSOLETE test_print_accept "print v_power2" {\[a6, a5, a9, a7, a3, a8\]}
# OBSOLETE
# OBSOLETE gdb_test "set v_power3 := \[b1:b2,e1\]" ""
# OBSOLETE test_print_accept "print v_power3" {\[b1:b2\]}
# OBSOLETE gdb_test "set v_power3 := \[b1, b3, b6:b7\]" ""
# OBSOLETE test_print_accept "print v_power3" {\[b1, b3, b6:b7\]}
# OBSOLETE gdb_test "set v_power3 := \[b1, b3:b4, b7\]" ""
# OBSOLETE test_print_accept "print v_power3" {\[b1, b3:b4, b7\]}
# OBSOLETE gdb_test "set v_power3 := \[b1, b4:b6, b7\]" ""
# OBSOLETE test_print_accept "print v_power3" {\[b1, b4:b7\]}
# OBSOLETE gdb_test "set v_power3 := \[b1:b7\]" ""
# OBSOLETE test_print_accept "print v_power3" {\[b1:b7\]}
# OBSOLETE gdb_test "set v_power3 := \[b5:b7, b1\]" ""
# OBSOLETE test_print_accept "print v_power3" {\[b1, b5:b7\]}
# OBSOLETE
# OBSOLETE gdb_test "set v_power4 := \[\"b\"\]" ""
# OBSOLETE test_print_accept "print v_power4" {\['b':'x'\]}
# OBSOLETE gdb_test "set v_power4 := \[5\]" ""
# OBSOLETE test_print_accept "print v_power4" {\['b':'x'\]}
# OBSOLETE gdb_test "set v_power4 := \['c':'f','g':'h','o':'t'\]" ""
# OBSOLETE test_print_accept "print v_power4" {\['c':'h', 'o':'t'\]}
# OBSOLETE gdb_test "set v_power4 := \['a','b','c','d','e','f'\]" ""
# OBSOLETE test_print_accept "print v_power4" {\['a':'f'\]}
# OBSOLETE gdb_test "set v_power4 := \['\^(0)':'\^(200)'\]" ""
# OBSOLETE test_print_accept "print v_power4" {\['\^\(0\)':'\^\(200\)'\]}
# OBSOLETE
# OBSOLETE gdb_test "set v_power5 := \[a8\]" ""
# OBSOLETE test_print_accept "print v_power5" {\[2:100\]}
# OBSOLETE gdb_test "set v_power5 := \[4\]" ""
# OBSOLETE test_print_accept "print v_power5" {\[4\]}
# OBSOLETE gdb_test "set v_power5 := \[3:95,9:100,10:107,200:250\]" ""
# OBSOLETE test_print_accept "print v_power5" {\[3:107, 200:250\]}
# OBSOLETE gdb_test "set v_power5 := \[2, 100:120, 350:400\]" ""
# OBSOLETE test_print_accept "print v_power5" {\[2, 100:120, 350:400\]}
# OBSOLETE gdb_test "set v_power5 := \[2:64,65:127,128:256,256:399,400\]" ""
# OBSOLETE test_print_accept "print v_power5" {\[2:400\]}
# OBSOLETE gdb_test "set v_power5 := \[3:95, 99:100, 101:107, 200:250\]" ""
# OBSOLETE test_print_accept "print v_power5" {\[3:95, 99:107, 200:250\]}
# OBSOLETE
# OBSOLETE gdb_test "set v_power6 := \[a8\]" ""
# OBSOLETE test_print_accept "print v_power6" {\[\]}
# OBSOLETE gdb_test "set v_power6 := \[4\]" ""
# OBSOLETE test_print_accept "print v_power6" {\[4\]}
# OBSOLETE gdb_test "set v_power6 := \[3:95, 99:100, 101:107, 200:250\]" ""
# OBSOLETE test_print_accept "print v_power6" {\[3:95, 99:107, 200:250\]}
# OBSOLETE gdb_test "set v_power6 := \[-111:0, 1:112, 11111:22222\]" ""
# OBSOLETE test_print_accept "print v_power6" {\[-111:112, 11111:22222\]}
# OBSOLETE gdb_test "set v_power6 := \[0, 200:4000, 6666:9999\]" ""
# OBSOLETE test_print_accept "print v_power6" {\[0, 200:4000, 6666:9999\]}
# OBSOLETE
# OBSOLETE # gdb_test "set v_power7 := \[a8\]" ""
# OBSOLETE # test_print_accept "print v_power7" {\[2:100\]}
# OBSOLETE # gdb_test "set v_power7 := \[4\]" ""
# OBSOLETE # test_print_accept "print v_power7" {\[4\]}
# OBSOLETE # gdb_test "set v_power7 := \[3:95, 99:100, 101:107, 200:250\]" ""
# OBSOLETE # test_print_accept "print v_power7" {\[3:95, 99:107, 200:250\]}
# OBSOLETE # gdb_test "set v_power7 := \[0, 1000, 1000000, 10000000000\]" ""
# OBSOLETE # test_print_accept "print v_power7" {\[0, 1000, 1000000, 1000000000\]}
# OBSOLETE # gdb_test "set v_power7 := \[-20000:100000, 111111:2222222\]" ""
# OBSOLETE # test_print_accept "print v_power7" {\[-20000:100000, 111111:2222222\]}
# OBSOLETE # gdb_test "set v_power7 := \[\]" ""
# OBSOLETE # test_print_accept "print v_power7" {\[3:95, 99:107, 200:250\]}
# OBSOLETE # gdb_test "set v_power7 := \[2:-500, -501:1, 20:370, -888:-920, 1000:2000, 1800:2500\]\ " ""
# OBSOLETE # test_print_accept "print v_power7" {\[-920:-888, -501:2, 20:370, 1000:2500\]}
# OBSOLETE # test_print_accept "print SIZE(v_power7)" ""
# OBSOLETE
# OBSOLETE
# OBSOLETE runto 58
# OBSOLETE test_print_accept "print v_set1 IN v1_power1" "TRUE"
# OBSOLETE test_print_accept "print v_set1 IN v2_power1" "FALSE"
# OBSOLETE
# OBSOLETE }
# OBSOLETE
# 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
# OBSOLETE if [set_lang_chill] then {
# OBSOLETE # test builtins as described in chapter 6.20.3 Z.200
# OBSOLETE
# OBSOLETE test_power
# OBSOLETE } else {
# OBSOLETE warning "$test_name tests suppressed."
# OBSOLETE }

View File

@ -1,100 +1,100 @@
# 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 was written by Fred Fish. (fnf@cygnus.com)
# Martin Pottendorfer (pottendo@aut.alcatel.at)
#
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "misc"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -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 }
}
return [gdb_test "show language" ".* source language is \"chill\".*" \
"set language to \"chill\""]
}
set prms_id 0
set bug_id 0
# 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 {
runto dummyfunc
# check upper/lower case
gdb_test "ptype BOOL" " = (bool|BOOL)"
gdb_test "ptype bool" " = (bool|BOOL)"
gdb_test "print otto" " = 42"
gdb_test "print OTTO" " = 42"
gdb_test "print otTO" " = 42"
gdb_test "print OTto" " = 42"
gdb_test "print NULL" " = NULL" "print emptiness literal"
# This tests PR 8496.
gdb_test {printf "%d %d.", 3+4,2} "7 2." "printf with 2 arguments"
# This tests GCH/924
gdb_test {print (h'23)} { = 35} "print parantised integer literal"
# Linux thinks this is at line 6, but is otherwise ok.
setup_xfail "i*86-pc-linux*-gnu"
gdb_test "info line" \
{Line 7 of .*misc.ch.* at address H'[0-9a-fA-F]+.*}\
"info about current line"
# check array () type (expr)
setup_xfail "m68*-*-hpux*"
gdb_test "print array () ubyte (foo)" { = \[\(0:11\): 0\]}
send_gdb "set var \$i := foo\n"
gdb_expect -re ".*$gdb_prompt $"
setup_xfail "m68*-*-hpux*"
gdb_test "print/x array () byte (\$i)" { = \[\(0:11\): H'0\]}
}
# 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 was written by Fred Fish. (fnf@cygnus.com)
# OBSOLETE # Martin Pottendorfer (pottendo@aut.alcatel.at)
# OBSOLETE #
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "misc"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -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
# 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 return [gdb_test "show language" ".* source language is \"chill\".*" \
# OBSOLETE "set language to \"chill\""]
# OBSOLETE }
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# 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 runto dummyfunc
# OBSOLETE # check upper/lower case
# OBSOLETE gdb_test "ptype BOOL" " = (bool|BOOL)"
# OBSOLETE gdb_test "ptype bool" " = (bool|BOOL)"
# OBSOLETE gdb_test "print otto" " = 42"
# OBSOLETE gdb_test "print OTTO" " = 42"
# OBSOLETE gdb_test "print otTO" " = 42"
# OBSOLETE gdb_test "print OTto" " = 42"
# OBSOLETE gdb_test "print NULL" " = NULL" "print emptiness literal"
# OBSOLETE
# OBSOLETE # This tests PR 8496.
# OBSOLETE gdb_test {printf "%d %d.", 3+4,2} "7 2." "printf with 2 arguments"
# OBSOLETE
# OBSOLETE # This tests GCH/924
# OBSOLETE gdb_test {print (h'23)} { = 35} "print parantised integer literal"
# OBSOLETE
# OBSOLETE # Linux thinks this is at line 6, but is otherwise ok.
# OBSOLETE setup_xfail "i*86-pc-linux*-gnu"
# OBSOLETE gdb_test "info line" \
# OBSOLETE {Line 7 of .*misc.ch.* at address H'[0-9a-fA-F]+.*}\
# OBSOLETE "info about current line"
# OBSOLETE
# OBSOLETE # check array () type (expr)
# OBSOLETE setup_xfail "m68*-*-hpux*"
# OBSOLETE gdb_test "print array () ubyte (foo)" { = \[\(0:11\): 0\]}
# OBSOLETE
# OBSOLETE send_gdb "set var \$i := foo\n"
# OBSOLETE gdb_expect -re ".*$gdb_prompt $"
# OBSOLETE setup_xfail "m68*-*-hpux*"
# OBSOLETE gdb_test "print/x array () byte (\$i)" { = \[\(0:11\): H'0\]}
# OBSOLETE }

View File

@ -1,187 +1,187 @@
# 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 "powerset"
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_card {} {
global passcount
verbose "testing builtin CARD"
set passcount 0
# discrete mode names
test_print_accept "print card(v_ps1)" "4"
test_print_accept "print card(v_ps2)" "15"
test_print_accept "print card(v_ps3)" "4"
test_print_accept "print card(v_ps4)" "11"
test_print_accept "print card(v_ps5)" "1"
test_print_accept "print card(v_ps51)" "0"
test_print_accept "print card(v_ps6)" "101"
# a failure
setup_xfail "*-*-*"
test_print_accept "print card(m_ps1)" "typename in invalid context"
}
proc test_min {} {
global passcount
verbose "testing builtin MIN"
set passcount 0
# discrete mode names
test_print_accept "print min(v_ps1)" "1"
test_print_accept "print min(v_ps2)" "-100"
test_print_accept "print min(v_ps3)" "bb"
test_print_accept "print min(v_ps4)" "','"
test_print_accept "print min(v_ps5)" "FALSE"
test_print_accept "print min(v_ps6)" "-50"
# a failure
setup_xfail "*-*-*"
test_print_accept "print min(v_ps51)" "MIN for empty powerset"
setup_xfail "*-*-*"
test_print_accept "print min(m_ps1)" "typename in invalid context"
}
proc test_max {} {
global passcount
verbose "testing builtin MIN"
set passcount 0
# discrete mode names
test_print_accept "print max(v_ps1)" "7"
test_print_accept "print max(v_ps2)" "100"
test_print_accept "print max(v_ps3)" "ii"
test_print_accept "print max(v_ps4)" "'z'"
test_print_accept "print max(v_ps5)" "FALSE"
test_print_accept "print max(v_ps6)" "50"
# test an IN
test_print_accept "print 0 in v_ps6" "TRUE"
# a failure
setup_xfail "*-*-*"
test_print_accept "print max(v_ps51)" "MAX for empty powerset"
}
# 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_card
test_min
test_max
} 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 "powerset"
# 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_card {} {
# OBSOLETE global passcount
# OBSOLETE
# OBSOLETE verbose "testing builtin CARD"
# OBSOLETE set passcount 0
# OBSOLETE
# OBSOLETE # discrete mode names
# OBSOLETE test_print_accept "print card(v_ps1)" "4"
# OBSOLETE test_print_accept "print card(v_ps2)" "15"
# OBSOLETE test_print_accept "print card(v_ps3)" "4"
# OBSOLETE test_print_accept "print card(v_ps4)" "11"
# OBSOLETE test_print_accept "print card(v_ps5)" "1"
# OBSOLETE test_print_accept "print card(v_ps51)" "0"
# OBSOLETE test_print_accept "print card(v_ps6)" "101"
# OBSOLETE
# OBSOLETE # a failure
# OBSOLETE setup_xfail "*-*-*"
# OBSOLETE test_print_accept "print card(m_ps1)" "typename in invalid context"
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_min {} {
# OBSOLETE global passcount
# OBSOLETE
# OBSOLETE verbose "testing builtin MIN"
# OBSOLETE set passcount 0
# OBSOLETE
# OBSOLETE # discrete mode names
# OBSOLETE test_print_accept "print min(v_ps1)" "1"
# OBSOLETE test_print_accept "print min(v_ps2)" "-100"
# OBSOLETE test_print_accept "print min(v_ps3)" "bb"
# OBSOLETE test_print_accept "print min(v_ps4)" "','"
# OBSOLETE test_print_accept "print min(v_ps5)" "FALSE"
# OBSOLETE test_print_accept "print min(v_ps6)" "-50"
# OBSOLETE
# OBSOLETE # a failure
# OBSOLETE setup_xfail "*-*-*"
# OBSOLETE test_print_accept "print min(v_ps51)" "MIN for empty powerset"
# OBSOLETE setup_xfail "*-*-*"
# OBSOLETE test_print_accept "print min(m_ps1)" "typename in invalid context"
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_max {} {
# OBSOLETE global passcount
# OBSOLETE
# OBSOLETE verbose "testing builtin MIN"
# OBSOLETE set passcount 0
# OBSOLETE
# OBSOLETE # discrete mode names
# OBSOLETE test_print_accept "print max(v_ps1)" "7"
# OBSOLETE test_print_accept "print max(v_ps2)" "100"
# OBSOLETE test_print_accept "print max(v_ps3)" "ii"
# OBSOLETE test_print_accept "print max(v_ps4)" "'z'"
# OBSOLETE test_print_accept "print max(v_ps5)" "FALSE"
# OBSOLETE test_print_accept "print max(v_ps6)" "50"
# OBSOLETE
# OBSOLETE # test an IN
# OBSOLETE test_print_accept "print 0 in v_ps6" "TRUE"
# OBSOLETE
# OBSOLETE # a failure
# OBSOLETE setup_xfail "*-*-*"
# OBSOLETE test_print_accept "print max(v_ps51)" "MAX for empty powerset"
# 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_card
# OBSOLETE test_min
# OBSOLETE test_max
# OBSOLETE } else {
# OBSOLETE warning "$test_name tests suppressed."
# OBSOLETE }

View File

@ -1,67 +1,67 @@
# Copyright 1992, 1994, 1995, 1996 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile2 "pr-4975-grt"
set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
set objfile2 ${objdir}/$subdir/${testfile2}.o
if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
perror "Couldn't compile ${srcfile2}"
return -1
}
set testfile "pr-4975"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
# This is needed (at least on SunOS4) to make sure the
# the symbol table is read.
runto "x"
# "You loose"? Why, thank you. (But I suspect "You lose" might have
# been what was intended).
gdb_test "finish" "You loose.*" "Runs and reads symbols OK"
}
do_tests
# OBSOLETE # Copyright 1992, 1994, 1995, 1996 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile2 "pr-4975-grt"
# OBSOLETE set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
# OBSOLETE set objfile2 ${objdir}/$subdir/${testfile2}.o
# OBSOLETE if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile2}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE set testfile "pr-4975"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE # This is needed (at least on SunOS4) to make sure the
# OBSOLETE # the symbol table is read.
# OBSOLETE runto "x"
# OBSOLETE # "You loose"? Why, thank you. (But I suspect "You lose" might have
# OBSOLETE # been what was intended).
# OBSOLETE gdb_test "finish" "You loose.*" "Runs and reads symbols OK"
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,62 +1,63 @@
# Copyright 1992, 1994, 1995, 1996 Free Software Foundation, Inc.
# OBSOLETE # Copyright 1992, 1994, 1995, 1996 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "pr-5016"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE runto dump
# OBSOLETE # Linux thinks type is "_cint" (and so does sparc-sun-sunos4, alpha-dec-osf2.0)
# OBSOLETE #setup_xfail "i*86-pc-linux*-gnu" "sparc-sun-sunos4*" "alpha-dec-osf2*"
# OBSOLETE gdb_test "whatis i" "type = m_index" "whatis int-range"
# OBSOLETE gdb_test_exact "ptype m_index" "type = RANGE (1:10)" "ptype m_index"
# OBSOLETE gdb_test_exact "whatis a" "type = /*LOC*/ vector"
# OBSOLETE gdb_test "ptype a" "type = /\\*LOC\\*/ ARRAY \\(1:10\\) (INT|int)"
# OBSOLETE gdb_test "step" ""
# OBSOLETE gdb_test_exact "whatis i" "type = long" "whatis loop counter i"
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests
# 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "pr-5016"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
runto dump
# Linux thinks type is "_cint" (and so does sparc-sun-sunos4, alpha-dec-osf2.0)
#setup_xfail "i*86-pc-linux*-gnu" "sparc-sun-sunos4*" "alpha-dec-osf2*"
gdb_test "whatis i" "type = m_index" "whatis int-range"
gdb_test_exact "ptype m_index" "type = RANGE (1:10)" "ptype m_index"
gdb_test_exact "whatis a" "type = /*LOC*/ vector"
gdb_test "ptype a" "type = /\\*LOC\\*/ ARRAY \\(1:10\\) (INT|int)"
gdb_test "step" ""
gdb_test_exact "whatis i" "type = long" "whatis loop counter i"
}
do_tests

View File

@ -1,85 +1,85 @@
# Copyright 1992, 1994, 1995 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "pr-5020"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
# This is needed (at least on SunOS4) to make sure the
# the symbol table is read.
gdb_test "break chillvars.ch:3" ""
gdb_test "delete 1" ""
gdb_test "set width 0" ""
gdb_test "set print sevenbit-strings" ""
gdb_test "set print address off" ""
test_pr_5020
}
proc test_pr_5020 {} {
global gdb_prompt
runto dummy_pr_5020
gdb_test_exact "print y" \
{= [('a'): [.l: 10, .b: TRUE], ('b'): [.l: 111, .b: FALSE]]}
gdb_test_exact "print boolarr" \
{= [(FALSE): [.l: 10, .b: TRUE], (TRUE): [.l: 111, .b: FALSE]]}
gdb_test_exact "print intarr" \
{= [(10): [.l: 10, .b: TRUE], (11): [.l: 111, .b: FALSE]]}
gdb_test_exact "print setarr" \
{= [(aa): [.l: 10, .b: TRUE], (bb): [.l: 111, .b: FALSE]]}
gdb_test "set print pretty" ""
gdb_test_exact "print y" \
{= [('a'): [
.l: 10,
.b: TRUE
], ('b'): [
.l: 111,
.b: FALSE
]]} "print y pretty"
}
do_tests
# OBSOLETE # Copyright 1992, 1994, 1995 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "pr-5020"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE # This is needed (at least on SunOS4) to make sure the
# OBSOLETE # the symbol table is read.
# OBSOLETE gdb_test "break chillvars.ch:3" ""
# OBSOLETE gdb_test "delete 1" ""
# OBSOLETE
# OBSOLETE gdb_test "set width 0" ""
# OBSOLETE gdb_test "set print sevenbit-strings" ""
# OBSOLETE gdb_test "set print address off" ""
# OBSOLETE
# OBSOLETE test_pr_5020
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_pr_5020 {} {
# OBSOLETE global gdb_prompt
# OBSOLETE runto dummy_pr_5020
# OBSOLETE gdb_test_exact "print y" \
# OBSOLETE {= [('a'): [.l: 10, .b: TRUE], ('b'): [.l: 111, .b: FALSE]]}
# OBSOLETE gdb_test_exact "print boolarr" \
# OBSOLETE {= [(FALSE): [.l: 10, .b: TRUE], (TRUE): [.l: 111, .b: FALSE]]}
# OBSOLETE gdb_test_exact "print intarr" \
# OBSOLETE {= [(10): [.l: 10, .b: TRUE], (11): [.l: 111, .b: FALSE]]}
# OBSOLETE gdb_test_exact "print setarr" \
# OBSOLETE {= [(aa): [.l: 10, .b: TRUE], (bb): [.l: 111, .b: FALSE]]}
# OBSOLETE gdb_test "set print pretty" ""
# OBSOLETE gdb_test_exact "print y" \
# OBSOLETE {= [('a'): [
# OBSOLETE .l: 10,
# OBSOLETE .b: TRUE
# OBSOLETE ], ('b'): [
# OBSOLETE .l: 111,
# OBSOLETE .b: FALSE
# OBSOLETE ]]} "print y pretty"
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,70 +1,70 @@
# Copyright 1992, 1994, 1995 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "pr-5022"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
# This is needed (at least on SunOS4) to make sure the
# the symbol table is read.
gdb_test "break gdbme.ch:3" ""
gdb_test "delete 1" ""
gdb_test "set width 0" ""
gdb_test "set print sevenbit-strings" ""
test_pr_5022
}
proc test_pr_5022 {} {
global gdb_prompt
runto dummy_pr_5022
gdb_test "p p" " = NULL" "print NULL pointer"
gdb_test "continue" ""
gdb_test "p p" {= PTR\(H'[0-9a-fA-F]+\)} "print non-NULL pointer"
}
do_tests
# OBSOLETE # Copyright 1992, 1994, 1995 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "pr-5022"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE # This is needed (at least on SunOS4) to make sure the
# OBSOLETE # the symbol table is read.
# OBSOLETE gdb_test "break gdbme.ch:3" ""
# OBSOLETE gdb_test "delete 1" ""
# OBSOLETE
# OBSOLETE gdb_test "set width 0" ""
# OBSOLETE gdb_test "set print sevenbit-strings" ""
# OBSOLETE
# OBSOLETE test_pr_5022
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc test_pr_5022 {} {
# OBSOLETE global gdb_prompt
# OBSOLETE runto dummy_pr_5022
# OBSOLETE gdb_test "p p" " = NULL" "print NULL pointer"
# OBSOLETE gdb_test "continue" ""
# OBSOLETE gdb_test "p p" {= PTR\(H'[0-9a-fA-F]+\)} "print non-NULL pointer"
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,64 +1,64 @@
# Copyright 1992, 1994, 1995, 1996 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile2 "pr-5646-grt"
set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
set objfile2 ${objdir}/$subdir/${testfile2}.o
if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
perror "Couldn't compile ${srcfile2}"
return -1
}
set testfile "pr-5646"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
runto p
gdb_test "next" ""
gdb_test_exact "print xx" {= [a:b]}
}
do_tests
# OBSOLETE # Copyright 1992, 1994, 1995, 1996 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile2 "pr-5646-grt"
# OBSOLETE set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
# OBSOLETE set objfile2 ${objdir}/$subdir/${testfile2}.o
# OBSOLETE if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile2}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE set testfile "pr-5646"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE runto p
# OBSOLETE gdb_test "next" ""
# OBSOLETE gdb_test_exact "print xx" {= [a:b]}
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,57 +1,57 @@
# Copyright 1992, 1994, 1995 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "pr-5984"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
send_gdb "set language chill\n" ;
gdb_test "break pr-5984.ch:6" ""
send_gdb "run\n"; gdb_expect -re "Breakpoint .*pr-5984.ch:6"
gdb_expect -re "$gdb_prompt $"
gdb_test "next" "Jason Dark.*" "next over Jason Dark"
}
do_tests
# OBSOLETE # Copyright 1992, 1994, 1995 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "pr-5984"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE send_gdb "set language chill\n" ;
# OBSOLETE
# OBSOLETE gdb_test "break pr-5984.ch:6" ""
# OBSOLETE send_gdb "run\n"; gdb_expect -re "Breakpoint .*pr-5984.ch:6"
# OBSOLETE gdb_expect -re "$gdb_prompt $"
# OBSOLETE gdb_test "next" "Jason Dark.*" "next over Jason Dark"
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,58 +1,58 @@
# Copyright 1995 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "pr-6292"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
send_gdb "set language chill\n" ;
gdb_test "break pr-6292.ch:15" ""
send_gdb "run\n"; gdb_expect -re "Breakpoint .*pr-6292.ch:15.*$gdb_prompt $"
gdb_test_exact "call klaus()" {here's klaus calling.}
gdb_test {set fred(10, i)} {a was '10'; b was '12'.}
gdb_test "print i" { = 13} "print i after call"
}
do_tests
# OBSOLETE # Copyright 1995 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "pr-6292"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE send_gdb "set language chill\n" ;
# OBSOLETE
# OBSOLETE gdb_test "break pr-6292.ch:15" ""
# OBSOLETE send_gdb "run\n"; gdb_expect -re "Breakpoint .*pr-6292.ch:15.*$gdb_prompt $"
# OBSOLETE gdb_test_exact "call klaus()" {here's klaus calling.}
# OBSOLETE gdb_test {set fred(10, i)} {a was '10'; b was '12'.}
# OBSOLETE gdb_test "print i" { = 13} "print i after call"
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,66 +1,66 @@
# Copyright 1995 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile2 "pr-6632-grt"
set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
set objfile2 ${objdir}/$subdir/${testfile2}.o
if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
perror "Couldn't compile ${srcfile2}"
return -1
}
set testfile "pr-6632"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} ${objfile2} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
runto p
gdb_test "whatis x" {type = m_dummy_range}
gdb_test_exact "ptype x" {type = m_dummy (dummy_6:dummy_22)}
gdb_test "print x" { = dummy_10}
}
do_tests
# OBSOLETE # Copyright 1995 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile2 "pr-6632-grt"
# OBSOLETE set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
# OBSOLETE set objfile2 ${objdir}/$subdir/${testfile2}.o
# OBSOLETE if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile2}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE set testfile "pr-6632"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} ${objfile2} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE runto p
# OBSOLETE gdb_test "whatis x" {type = m_dummy_range}
# OBSOLETE gdb_test_exact "ptype x" {type = m_dummy (dummy_6:dummy_22)}
# OBSOLETE gdb_test "print x" { = dummy_10}
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,65 +1,65 @@
# Copyright 1995, 1996 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
# Note we use pr-8136.ch for pr-8134.exp as well as pr-8136.exp.
set testfile2 "func1"
set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
set objfile2 ${objdir}/$subdir/${testfile2}.o
if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
perror "Couldn't compile ${srcfile2}"
return -1
}
set testfile "pr-8134"
set srcfile ${srcdir}/$subdir/pr-8136.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
runto p1
gdb_test "print first" "= 1"
gdb_test "print last" "= 10"
}
do_tests
# OBSOLETE # Copyright 1995, 1996 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE # Note we use pr-8136.ch for pr-8134.exp as well as pr-8136.exp.
# OBSOLETE set testfile2 "func1"
# OBSOLETE set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
# OBSOLETE set objfile2 ${objdir}/$subdir/${testfile2}.o
# OBSOLETE if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile2}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE set testfile "pr-8134"
# OBSOLETE set srcfile ${srcdir}/$subdir/pr-8136.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE runto p1
# OBSOLETE gdb_test "print first" "= 1"
# OBSOLETE gdb_test "print last" "= 10"
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,63 +1,63 @@
# Copyright 1995 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile2 "func1"
set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
set objfile2 ${objdir}/$subdir/${testfile2}.o
if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
perror "Couldn't compile ${srcfile2}"
return -1
}
set testfile "pr-8136"
set srcfile ${srcdir}/$subdir/pr-8136.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
runto p1
gdb_test "print ps" {= \[e3, e7:e9\]}
}
do_tests
# OBSOLETE # Copyright 1995 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile2 "func1"
# OBSOLETE set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
# OBSOLETE set objfile2 ${objdir}/$subdir/${testfile2}.o
# OBSOLETE if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile2}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE set testfile "pr-8136"
# OBSOLETE set srcfile ${srcdir}/$subdir/pr-8136.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE runto p1
# OBSOLETE gdb_test "print ps" {= \[e3, e7:e9\]}
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,61 +1,61 @@
# Copyright 1995, 1996 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_load $binfile
gdb_test "set language chill" ""
gdb_test "set var \$i:=xx" ""
gdb_test "print \$i" {= \[.c: "", .b: B'00000000', .boo: FALSE\]}
}
if [skip_chill_tests] then { continue }
# Check to see if we have an executable to test. If not, then either we
# haven't tried to compile one, or the compilation failed for some reason.
# In either case, just notify the user and skip the tests in this file.
set testfile "pr-8405"
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
}
if ![file exists $binfile] then {
warning "$binfile does not exist; tests suppressed." 0
} else {
do_tests
}
# OBSOLETE # Copyright 1995, 1996 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE gdb_test "set var \$i:=xx" ""
# OBSOLETE gdb_test "print \$i" {= \[.c: "", .b: B'00000000', .boo: FALSE\]}
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE # Check to see if we have an executable to test. If not, then either we
# OBSOLETE # haven't tried to compile one, or the compilation failed for some reason.
# OBSOLETE # In either case, just notify the user and skip the tests in this file.
# OBSOLETE
# OBSOLETE set testfile "pr-8405"
# 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 if ![file exists $binfile] then {
# OBSOLETE warning "$binfile does not exist; tests suppressed." 0
# OBSOLETE } else {
# OBSOLETE do_tests
# OBSOLETE }

View File

@ -1,64 +1,64 @@
# Copyright 1992, 1996 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "pr-8742"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
runto dummy
# Haven't investigated why these fail on mips-sgi-irix*
setup_xfail "m68*-*-hpux*" "mips*-sgi-irix*"
gdb_test {call x(p [1, 3, 5])} "1 3 5 " "pass int powerset tuple"
setup_xfail "mips*-sgi-irix*"
gdb_test {call y(s_ps [sc])} "sc " "pass set powerset tuple"
setup_xfail "m68*-*-hpux*" "mips*-sgi-irix*"
gdb_test {call x([1, 3, 5])} "1 3 5 " "pass modeless int powerset tuple"
setup_xfail "mips*-sgi-irix*"
gdb_test {call y([sc])} "sc " "pass modeless set powerset tuple"
}
do_tests
# OBSOLETE # Copyright 1992, 1996 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "pr-8742"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE runto dummy
# OBSOLETE
# OBSOLETE # Haven't investigated why these fail on mips-sgi-irix*
# OBSOLETE setup_xfail "m68*-*-hpux*" "mips*-sgi-irix*"
# OBSOLETE gdb_test {call x(p [1, 3, 5])} "1 3 5 " "pass int powerset tuple"
# OBSOLETE setup_xfail "mips*-sgi-irix*"
# OBSOLETE gdb_test {call y(s_ps [sc])} "sc " "pass set powerset tuple"
# OBSOLETE setup_xfail "m68*-*-hpux*" "mips*-sgi-irix*"
# OBSOLETE gdb_test {call x([1, 3, 5])} "1 3 5 " "pass modeless int powerset tuple"
# OBSOLETE setup_xfail "mips*-sgi-irix*"
# OBSOLETE gdb_test {call y([sc])} "sc " "pass modeless set powerset tuple"
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,61 +1,61 @@
# Copyright 1996 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
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile2 "pr-8894-grt"
set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
set objfile2 ${objdir}/$subdir/${testfile2}.o
if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
perror "Couldn't compile ${srcfile2}"
return -1
}
set testfile "pr-8894"
set srcfile ${srcdir}/$subdir/$testfile.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
gdb_test "print size(m_byte)" { = 2}
gdb_test "print size(m_struct)" { = 6}
}
do_tests
# OBSOLETE # Copyright 1996 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 if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile2 "pr-8894-grt"
# OBSOLETE set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
# OBSOLETE set objfile2 ${objdir}/$subdir/${testfile2}.o
# OBSOLETE if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile2}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE set testfile "pr-8894"
# OBSOLETE set srcfile ${srcdir}/$subdir/$testfile.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE gdb_test "print size(m_byte)" { = 2}
# OBSOLETE gdb_test "print size(m_struct)" { = 6}
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,62 +1,62 @@
# Copyright 1996 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_load $binfile
gdb_test "set language chill" ""
runto pr-9095.ch:12
gdb_test {p v_arr2(5)->.p(5)} "reference value used as function" \
"bad call using pointer"
}
if [skip_chill_tests] then { continue }
# Check to see if we have an executable to test. If not, then either we
# haven't tried to compile one, or the compilation failed for some reason.
# In either case, just notify the user and skip the tests in this file.
set testfile "pr-9095"
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
}
if ![file exists $binfile] then {
warning "$binfile does not exist; tests suppressed." 0
} else {
do_tests
}
# OBSOLETE # Copyright 1996 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE runto pr-9095.ch:12
# OBSOLETE gdb_test {p v_arr2(5)->.p(5)} "reference value used as function" \
# OBSOLETE "bad call using pointer"
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE # Check to see if we have an executable to test. If not, then either we
# OBSOLETE # haven't tried to compile one, or the compilation failed for some reason.
# OBSOLETE # In either case, just notify the user and skip the tests in this file.
# OBSOLETE
# OBSOLETE set testfile "pr-9095"
# 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 if ![file exists $binfile] then {
# OBSOLETE warning "$binfile does not exist; tests suppressed." 0
# OBSOLETE } else {
# OBSOLETE do_tests
# OBSOLETE }

View File

@ -1,79 +1,79 @@
# 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 was written by Fred Fish. (fnf@cygnus.com)
# Martin Pottendorfer (pottendo@aut.alcatel.at)
#
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "pr-9946"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -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 }
}
return [gdb_test "show language" ".* source language is \"chill\".*" \
"set language to \"chill\""]
}
set prms_id 0
set bug_id 0
# 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 {
runto x_
gdb_test "next" ""
# check comparison of SET's
gdb_test {print xyz=moving} { = TRUE}
gdb_test {print xyz/=moving} { = FALSE}
gdb_test {print xyz<moving} { = FALSE}
gdb_test {print xyz<=moving} { = TRUE}
gdb_test {print xyz>moving} { = FALSE}
gdb_test {print xyz>=moving} { = TRUE}
}
# 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 was written by Fred Fish. (fnf@cygnus.com)
# OBSOLETE # Martin Pottendorfer (pottendo@aut.alcatel.at)
# OBSOLETE #
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "pr-9946"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -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
# 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 return [gdb_test "show language" ".* source language is \"chill\".*" \
# OBSOLETE "set language to \"chill\""]
# OBSOLETE }
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# 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 runto x_
# OBSOLETE gdb_test "next" ""
# OBSOLETE # check comparison of SET's
# OBSOLETE gdb_test {print xyz=moving} { = TRUE}
# OBSOLETE gdb_test {print xyz/=moving} { = FALSE}
# OBSOLETE gdb_test {print xyz<moving} { = FALSE}
# OBSOLETE gdb_test {print xyz<=moving} { = TRUE}
# OBSOLETE gdb_test {print xyz>moving} { = FALSE}
# OBSOLETE gdb_test {print xyz>=moving} { = TRUE}
# OBSOLETE }

View File

@ -1,77 +1,77 @@
# Copyright 1994, 1995 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "result"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
gdb_test "set width 0" ""
gdb_test "set print sevenbit-strings" ""
gdb_test "set print address off" ""
# simple function
runto simple_func
gdb_test "step 2" ""
gdb_test "print j" "= 5"
gdb_test "p RESULT" "= 10"
gdb_test "continue" ""
gdb_test "print i" "= 7"
gdb_test "step 4" ""
gdb_test "set RESULT := 50" ""
gdb_test "finish" ""
gdb_test "step" ""
gdb_test "print i" "= 50"
# returning a structure
runto ret_struct
gdb_test "step 2" ""
gdb_test "p result" {\[.l: 33, .b: FALSE\]}
gdb_test "set var result := \[383, TRUE\]" ""
gdb_test "finish" ""
gdb_test "p v_struct" {\[.l: 383, .b: TRUE\]}
}
do_tests
# OBSOLETE # Copyright 1994, 1995 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "result"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE gdb_test "set width 0" ""
# OBSOLETE gdb_test "set print sevenbit-strings" ""
# OBSOLETE gdb_test "set print address off" ""
# OBSOLETE
# OBSOLETE # simple function
# OBSOLETE runto simple_func
# OBSOLETE gdb_test "step 2" ""
# OBSOLETE gdb_test "print j" "= 5"
# OBSOLETE gdb_test "p RESULT" "= 10"
# OBSOLETE gdb_test "continue" ""
# OBSOLETE gdb_test "print i" "= 7"
# OBSOLETE gdb_test "step 4" ""
# OBSOLETE gdb_test "set RESULT := 50" ""
# OBSOLETE gdb_test "finish" ""
# OBSOLETE gdb_test "step" ""
# OBSOLETE gdb_test "print i" "= 50"
# OBSOLETE
# OBSOLETE # returning a structure
# OBSOLETE runto ret_struct
# OBSOLETE gdb_test "step 2" ""
# OBSOLETE gdb_test "p result" {\[.l: 33, .b: FALSE\]}
# OBSOLETE gdb_test "set var result := \[383, TRUE\]" ""
# OBSOLETE gdb_test "finish" ""
# OBSOLETE gdb_test "p v_struct" {\[.l: 383, .b: TRUE\]}
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,73 +1,73 @@
# Copyright 1995, 1996 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
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "string"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
# These tests based on Cygnus PR chill/5696.
runto string.ch:22
gdb_test "p s20" { = "Moser Wilfried"} "print simple vstring"
gdb_test "p s20(1)" { = 'o'} "print vstring element"
gdb_test "p s20(1:3)" { = "ose"} "print vstring slice (:)"
gdb_test "p s20(2 up 3)" { = "ser"} "print vstring slice (up)"
gdb_test "p s10" { = "1234567890"} "print simple string"
gdb_test "p s10(1)" { = '2'} "print string element"
gdb_test "p s10(1:3)" { = "234"} "print string slice (:)"
gdb_test "p s10(2 up 3)" { = "345"} "print string slice (up)"
gdb_test "p length(s10)" { = 10} "print string length"
gdb_test "p length(s20)" { = 14} "print varying string length"
gdb_test "p lower(s10)" { = 0} "print string lower"
gdb_test "p upper(s10)" { = 9} "print string upper"
gdb_test "p lower(s20)" { = 0} "print varying string lower"
gdb_test "p upper(s20)" { = 19} "print varying string upper"
# These tests are based on Cygnus PR chill/9078.
gdb_test "print foo // bar" { = "Moser Wilfried"}
gdb_test "print foo // bar1" { = "Moser abcde"}
gdb_test "print foo1 // bar1" { = "12345abcde"}
}
do_tests
# OBSOLETE # Copyright 1995, 1996 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 if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "string"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE # These tests based on Cygnus PR chill/5696.
# OBSOLETE runto string.ch:22
# OBSOLETE gdb_test "p s20" { = "Moser Wilfried"} "print simple vstring"
# OBSOLETE gdb_test "p s20(1)" { = 'o'} "print vstring element"
# OBSOLETE gdb_test "p s20(1:3)" { = "ose"} "print vstring slice (:)"
# OBSOLETE gdb_test "p s20(2 up 3)" { = "ser"} "print vstring slice (up)"
# OBSOLETE gdb_test "p s10" { = "1234567890"} "print simple string"
# OBSOLETE gdb_test "p s10(1)" { = '2'} "print string element"
# OBSOLETE gdb_test "p s10(1:3)" { = "234"} "print string slice (:)"
# OBSOLETE gdb_test "p s10(2 up 3)" { = "345"} "print string slice (up)"
# OBSOLETE
# OBSOLETE gdb_test "p length(s10)" { = 10} "print string length"
# OBSOLETE gdb_test "p length(s20)" { = 14} "print varying string length"
# OBSOLETE gdb_test "p lower(s10)" { = 0} "print string lower"
# OBSOLETE gdb_test "p upper(s10)" { = 9} "print string upper"
# OBSOLETE gdb_test "p lower(s20)" { = 0} "print varying string lower"
# OBSOLETE gdb_test "p upper(s20)" { = 19} "print varying string upper"
# OBSOLETE
# OBSOLETE # These tests are based on Cygnus PR chill/9078.
# OBSOLETE gdb_test "print foo // bar" { = "Moser Wilfried"}
# OBSOLETE gdb_test "print foo // bar1" { = "Moser abcde"}
# OBSOLETE gdb_test "print foo1 // bar1" { = "12345abcde"}
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

File diff suppressed because it is too large Load Diff

View File

@ -1,271 +1,271 @@
# Copyright 1992, 1995, 1996, 1997, 1999 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
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set prms_id 0
set bug_id 0
# Set the current language to chill. This counts as a test. If it
# fails, then we skip the other tests.
set testfile "tests2"
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
}
global infinity
if [istarget "i*86-*-sysv4*"] then {
set infinity "inf"
} else {
set infinity "Infinity"
}
proc set_lang_chill {} {
global gdb_prompt
global binfile objdir subdir
if ![file exists $objdir/$subdir/$binfile] then {
return 0
}
verbose "loading file '$objdir/$subdir/$binfile'"
gdb_load $objdir/$subdir/$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 dummyfunc\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
}
}
}
# checks if structure was accessed correctly
proc test_write { args } {
global gdb_prompt
if [llength $args]==5 then {
set message [lindex $args 4]
set extended [lindex $args 3]
set matchval [lindex $args 2]
} elseif [llength $args]==4 then {
set message [lindex $args 3]
set matchval [lindex $args 2]
set extended ""
} elseif [llength $args]==3 then {
set message [lindex $args 2]
set extended ""
} else {
warning "test ($args) write called with wrong number of arguments"
return
}
set location [lindex $args 0]
set value [lindex $args 1]
if ![info exists matchval] then {
set matchval $value
}
verbose "loc: $location, val: $value, msg: $message, ext: $extended, match: $matchval"
verbose "setting var $value..."
send_gdb "set var $location.m$extended := $value\n"
gdb_expect -re ".*$gdb_prompt $" {}
gdb_test "print $location" \
".*= \[\[\]\\.p1: 2863311530, \\.m: $matchval, \\.p2: 1431655765\[\]\]"\
"$message"
}
# test write access from gdb (setvar x:=y) from gdb
proc write_access { } {
global infinity
verbose "testing write access to locations"
# discrete modes
test_write b1 127 "byte write 1"
test_write b1 -128 "byte write 2"
test_write b1 0 "byte write 3"
test_write ub1 255 "ubyte write 1"
test_write ub1 0 "ubyte write 2"
test_write ub1 42 "ubyte write 3"
test_write i1 32767 "int write 1"
test_write i1 -32768 "int write 2"
test_write i1 0 "int write 3"
test_write ui1 65535 "uint write 1"
test_write ui1 0 "uint write 2"
test_write ui1 123 "uint write 3"
test_write l1 2147483647 "long write 1"
test_write l1 -2147483648 "long write 2"
test_write l1 0 "long write 3"
test_write ul1 4294967295 "ulong write 1"
test_write ul1 0 "ulong write 2"
test_write ul1 1000000 "ulong write 3"
test_write bo1 FALSE "bool write 1"
test_write bo1 TRUE "bool write 2"
test_write c1 \"1234\" "char write 1"
test_write c2 \"1234567\" "char write 2"
test_write c3 \"654321\" "char write 3"
test_write c4 C'65' 'e' "char write 4"
test_write bi1 B'10100101' "bitstring write 1"
test_write bi2 B'0101001010' "bitstring write 2"
test_write se1 a "set write 1"
test_write se1 h "set write 2"
# The following two use numbered sets with too-large values.
setup_xfail "*-*-*"
test_write nse1 nb "numbered set write 1"
setup_xfail "*-*-*"
test_write nse1 nc "numbered set write 2"
test_write r1 127 "range write 1"
test_write r2 32767 "range write 2"
test_write r3 2147483647 "range write 3"
# powerset modes
test_write p1 {[pa:ph]} {\[pa:ph\]} "powerset write 1"
test_write p1 {[pa, pc:pf, ph]} {\[pa, pc:pf, ph\]} "powerset write 2"
test_write p1 {[pa, pc, pe, pg]} {\[pa, pc, pe, pg\]} "powerset write 3"
test_write p1 {[]} {\[\]} "powerset write 4"
test_write p2 {[1:32]} {\[1:32\]} "powerset write 5"
test_write p2 {[1, 3:30, 32]} {\[1, 3:30, 32\]} "powerset write 6"
test_write p2 {[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31]} {\[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31\]} \
"powerset write 7"
test_write p2 {[]} {\[\]} "powerset write 8"
# Fixme: this should be rejected by gnuchill
# test_write p3 {[-2147483648:2147483647]} {\[-2147483648:2147483647\]} \
# "powerset write 9"
# test_write p3 {[-2147483648, -1000000:1000000, 2147483647]} \
# {\[-2147483648, -1000000:1000000, 2147483647\]} \
# "powerset write 10"
# test_write p3 {[-99, -97, -95, 1001, 1003, 1005]} \
# {\[-99, -97, -95, 1001, 1003, 1005\]} "powerset write 11"
# test_write p3 {[]} {\[\]} "powerset write 12"
# reference modes
test_write ref1 ->ref1 {H'[0-9a-fA-F]+} "reference write 1"
test_write ref2 ->b1 {H'[0-9a-fA-F]+} "reference write 2"
test_write ref1 NULL "reference write 3"
test_write ref2 NULL "reference write 4"
# procedure modes
test_write pr1 NULL "procefure write 1"
# FIXME: remove when NULL is understood
test_write pr1 0 NULL "procefure write 2"
test_write pr1 dummyfunc {H'[0-9a-fA-F]+ <dummyfunc>} "procedure write 3"
# timing modes, FIXME when callbacks to timefunctions are implemented
#test_write ti1 abstime(1970, 3, 12, 10, 43, 0) {} "time write 1"
#test_write ti2 <set somehow a duration>
xfail "timing modes not implemented yet"
# real modes
# This ones
test_write re1 42.03 {42.0[0-9]*} "real write 1"
test_write re1 0 "real write 2"
test_write re1 "1e+38" {1e\+38|1\.0[0-9]*e\+38|9\.9[0-9]*e\+37} \
"real write 3"
setup_xfail "i*86-pc-linux-gnu" "m68*-*-hpux*"
test_write re1 "1e+39" $infinity "real write 4"
test_write re2 42.03 {42.0[0-9]*} "real write 5"
test_write re2 0 "real write 6"
test_write re2 "1e+308" {1e\+308} "real write 7"
setup_xfail "i*86-pc-linux-gnu" "m68*-*-hpux*"
test_write re2 "1e+309" $infinity "real write 8"
# array modes
test_write arrl1 {[(1:3): [(1:2): -128]]} {\[\(1:3\): \[\(1:2\): -128\]\]}\
"array write 1"
test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\
"array write 2"
test_write arrl1 {[(1): [(1:2): 127], (2): [(1:2): -128], (3): [(1:2): 127]]} {\[\(1\): \[\(1:2\): 127\], \(2\): \[\(1:2\): -128\], \(3\): \[\(1:2\): 127\]\]}\
"array write 3"
test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\
"array write 4"
setup_xfail "*-*-*"
# Bogus test case - type mismatch?
test_write arrl1 {[(1): 127, (2): -128]} "array write 5"
test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\
"array write 6"
# structure modes
test_write strul1 {[.a: -32768, .b: 32767, .ch: "ZZZZ"]} \
{\[\.a: -32768, \.b: 32767, \.ch: \"ZZZZ\"\]} \
"structure write 1"
test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \
{\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \
"structure write 2"
test_write strul1 -32768 {\[\.a: -32768, \.b: 0, \.ch: \"0000\"\]} \
{.a} "structure write 3"
test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \
{\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \
"structure write 4"
test_write strul1 -32768 {\[\.a: 0, \.b: -32768, \.ch: \"0000\"\]} \
{.b} "structure write 5"
test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \
{\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \
"structure write 6"
test_write strul1 \"HUGO\" {\[\.a: 0, \.b: 0, \.ch: \"HUGO\"\]} \
{.ch} "structure write 7"
}
# Start with a fresh gdb.
set binfile "tests2.exe"
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_test "set print sevenbit-strings" ".*"
if [set_lang_chill] then {
write_access
} else {
warning "$test_name tests suppressed."
}
# OBSOLETE # Copyright 1992, 1995, 1996, 1997, 1999 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 if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# 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 set testfile "tests2"
# 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 global infinity
# OBSOLETE if [istarget "i*86-*-sysv4*"] then {
# OBSOLETE set infinity "inf"
# OBSOLETE } else {
# OBSOLETE set infinity "Infinity"
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc set_lang_chill {} {
# OBSOLETE global gdb_prompt
# OBSOLETE global binfile objdir subdir
# OBSOLETE
# OBSOLETE if ![file exists $objdir/$subdir/$binfile] then {
# OBSOLETE return 0
# OBSOLETE }
# OBSOLETE verbose "loading file '$objdir/$subdir/$binfile'"
# OBSOLETE gdb_load $objdir/$subdir/$binfile
# OBSOLETE
# 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 dummyfunc\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 # checks if structure was accessed correctly
# OBSOLETE proc test_write { args } {
# OBSOLETE global gdb_prompt
# OBSOLETE
# OBSOLETE if [llength $args]==5 then {
# OBSOLETE set message [lindex $args 4]
# OBSOLETE set extended [lindex $args 3]
# OBSOLETE set matchval [lindex $args 2]
# OBSOLETE } elseif [llength $args]==4 then {
# OBSOLETE set message [lindex $args 3]
# OBSOLETE set matchval [lindex $args 2]
# OBSOLETE set extended ""
# OBSOLETE } elseif [llength $args]==3 then {
# OBSOLETE set message [lindex $args 2]
# OBSOLETE set extended ""
# OBSOLETE } else {
# OBSOLETE warning "test ($args) write called with wrong number of arguments"
# OBSOLETE return
# OBSOLETE }
# OBSOLETE
# OBSOLETE set location [lindex $args 0]
# OBSOLETE set value [lindex $args 1]
# OBSOLETE if ![info exists matchval] then {
# OBSOLETE set matchval $value
# OBSOLETE }
# OBSOLETE verbose "loc: $location, val: $value, msg: $message, ext: $extended, match: $matchval"
# OBSOLETE
# OBSOLETE verbose "setting var $value..."
# OBSOLETE send_gdb "set var $location.m$extended := $value\n"
# OBSOLETE gdb_expect -re ".*$gdb_prompt $" {}
# OBSOLETE gdb_test "print $location" \
# OBSOLETE ".*= \[\[\]\\.p1: 2863311530, \\.m: $matchval, \\.p2: 1431655765\[\]\]"\
# OBSOLETE "$message"
# OBSOLETE }
# OBSOLETE
# OBSOLETE # test write access from gdb (setvar x:=y) from gdb
# OBSOLETE proc write_access { } {
# OBSOLETE global infinity
# OBSOLETE
# OBSOLETE verbose "testing write access to locations"
# OBSOLETE
# OBSOLETE # discrete modes
# OBSOLETE test_write b1 127 "byte write 1"
# OBSOLETE test_write b1 -128 "byte write 2"
# OBSOLETE test_write b1 0 "byte write 3"
# OBSOLETE test_write ub1 255 "ubyte write 1"
# OBSOLETE test_write ub1 0 "ubyte write 2"
# OBSOLETE test_write ub1 42 "ubyte write 3"
# OBSOLETE test_write i1 32767 "int write 1"
# OBSOLETE test_write i1 -32768 "int write 2"
# OBSOLETE test_write i1 0 "int write 3"
# OBSOLETE test_write ui1 65535 "uint write 1"
# OBSOLETE test_write ui1 0 "uint write 2"
# OBSOLETE test_write ui1 123 "uint write 3"
# OBSOLETE test_write l1 2147483647 "long write 1"
# OBSOLETE test_write l1 -2147483648 "long write 2"
# OBSOLETE test_write l1 0 "long write 3"
# OBSOLETE test_write ul1 4294967295 "ulong write 1"
# OBSOLETE test_write ul1 0 "ulong write 2"
# OBSOLETE test_write ul1 1000000 "ulong write 3"
# OBSOLETE test_write bo1 FALSE "bool write 1"
# OBSOLETE test_write bo1 TRUE "bool write 2"
# OBSOLETE test_write c1 \"1234\" "char write 1"
# OBSOLETE test_write c2 \"1234567\" "char write 2"
# OBSOLETE test_write c3 \"654321\" "char write 3"
# OBSOLETE test_write c4 C'65' 'e' "char write 4"
# OBSOLETE test_write bi1 B'10100101' "bitstring write 1"
# OBSOLETE test_write bi2 B'0101001010' "bitstring write 2"
# OBSOLETE test_write se1 a "set write 1"
# OBSOLETE test_write se1 h "set write 2"
# OBSOLETE # The following two use numbered sets with too-large values.
# OBSOLETE setup_xfail "*-*-*"
# OBSOLETE test_write nse1 nb "numbered set write 1"
# OBSOLETE setup_xfail "*-*-*"
# OBSOLETE test_write nse1 nc "numbered set write 2"
# OBSOLETE test_write r1 127 "range write 1"
# OBSOLETE test_write r2 32767 "range write 2"
# OBSOLETE test_write r3 2147483647 "range write 3"
# OBSOLETE
# OBSOLETE # powerset modes
# OBSOLETE test_write p1 {[pa:ph]} {\[pa:ph\]} "powerset write 1"
# OBSOLETE test_write p1 {[pa, pc:pf, ph]} {\[pa, pc:pf, ph\]} "powerset write 2"
# OBSOLETE test_write p1 {[pa, pc, pe, pg]} {\[pa, pc, pe, pg\]} "powerset write 3"
# OBSOLETE test_write p1 {[]} {\[\]} "powerset write 4"
# OBSOLETE test_write p2 {[1:32]} {\[1:32\]} "powerset write 5"
# OBSOLETE test_write p2 {[1, 3:30, 32]} {\[1, 3:30, 32\]} "powerset write 6"
# OBSOLETE test_write p2 {[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31]} {\[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31\]} \
# OBSOLETE "powerset write 7"
# OBSOLETE test_write p2 {[]} {\[\]} "powerset write 8"
# OBSOLETE
# OBSOLETE # Fixme: this should be rejected by gnuchill
# OBSOLETE # test_write p3 {[-2147483648:2147483647]} {\[-2147483648:2147483647\]} \
# OBSOLETE # "powerset write 9"
# OBSOLETE # test_write p3 {[-2147483648, -1000000:1000000, 2147483647]} \
# OBSOLETE # {\[-2147483648, -1000000:1000000, 2147483647\]} \
# OBSOLETE # "powerset write 10"
# OBSOLETE # test_write p3 {[-99, -97, -95, 1001, 1003, 1005]} \
# OBSOLETE # {\[-99, -97, -95, 1001, 1003, 1005\]} "powerset write 11"
# OBSOLETE # test_write p3 {[]} {\[\]} "powerset write 12"
# OBSOLETE
# OBSOLETE # reference modes
# OBSOLETE test_write ref1 ->ref1 {H'[0-9a-fA-F]+} "reference write 1"
# OBSOLETE test_write ref2 ->b1 {H'[0-9a-fA-F]+} "reference write 2"
# OBSOLETE test_write ref1 NULL "reference write 3"
# OBSOLETE test_write ref2 NULL "reference write 4"
# OBSOLETE
# OBSOLETE # procedure modes
# OBSOLETE test_write pr1 NULL "procefure write 1"
# OBSOLETE # FIXME: remove when NULL is understood
# OBSOLETE test_write pr1 0 NULL "procefure write 2"
# OBSOLETE test_write pr1 dummyfunc {H'[0-9a-fA-F]+ <dummyfunc>} "procedure write 3"
# OBSOLETE
# OBSOLETE # timing modes, FIXME when callbacks to timefunctions are implemented
# OBSOLETE #test_write ti1 abstime(1970, 3, 12, 10, 43, 0) {} "time write 1"
# OBSOLETE #test_write ti2 <set somehow a duration>
# OBSOLETE xfail "timing modes not implemented yet"
# OBSOLETE
# OBSOLETE # real modes
# OBSOLETE # This ones
# OBSOLETE test_write re1 42.03 {42.0[0-9]*} "real write 1"
# OBSOLETE test_write re1 0 "real write 2"
# OBSOLETE test_write re1 "1e+38" {1e\+38|1\.0[0-9]*e\+38|9\.9[0-9]*e\+37} \
# OBSOLETE "real write 3"
# OBSOLETE setup_xfail "i*86-pc-linux-gnu" "m68*-*-hpux*"
# OBSOLETE test_write re1 "1e+39" $infinity "real write 4"
# OBSOLETE test_write re2 42.03 {42.0[0-9]*} "real write 5"
# OBSOLETE test_write re2 0 "real write 6"
# OBSOLETE test_write re2 "1e+308" {1e\+308} "real write 7"
# OBSOLETE setup_xfail "i*86-pc-linux-gnu" "m68*-*-hpux*"
# OBSOLETE test_write re2 "1e+309" $infinity "real write 8"
# OBSOLETE # array modes
# OBSOLETE test_write arrl1 {[(1:3): [(1:2): -128]]} {\[\(1:3\): \[\(1:2\): -128\]\]}\
# OBSOLETE "array write 1"
# OBSOLETE test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\
# OBSOLETE "array write 2"
# OBSOLETE test_write arrl1 {[(1): [(1:2): 127], (2): [(1:2): -128], (3): [(1:2): 127]]} {\[\(1\): \[\(1:2\): 127\], \(2\): \[\(1:2\): -128\], \(3\): \[\(1:2\): 127\]\]}\
# OBSOLETE "array write 3"
# OBSOLETE test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\
# OBSOLETE "array write 4"
# OBSOLETE setup_xfail "*-*-*"
# OBSOLETE # Bogus test case - type mismatch?
# OBSOLETE test_write arrl1 {[(1): 127, (2): -128]} "array write 5"
# OBSOLETE test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\
# OBSOLETE "array write 6"
# OBSOLETE
# OBSOLETE # structure modes
# OBSOLETE test_write strul1 {[.a: -32768, .b: 32767, .ch: "ZZZZ"]} \
# OBSOLETE {\[\.a: -32768, \.b: 32767, \.ch: \"ZZZZ\"\]} \
# OBSOLETE "structure write 1"
# OBSOLETE test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \
# OBSOLETE {\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \
# OBSOLETE "structure write 2"
# OBSOLETE test_write strul1 -32768 {\[\.a: -32768, \.b: 0, \.ch: \"0000\"\]} \
# OBSOLETE {.a} "structure write 3"
# OBSOLETE test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \
# OBSOLETE {\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \
# OBSOLETE "structure write 4"
# OBSOLETE test_write strul1 -32768 {\[\.a: 0, \.b: -32768, \.ch: \"0000\"\]} \
# OBSOLETE {.b} "structure write 5"
# OBSOLETE test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \
# OBSOLETE {\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \
# OBSOLETE "structure write 6"
# OBSOLETE test_write strul1 \"HUGO\" {\[\.a: 0, \.b: 0, \.ch: \"HUGO\"\]} \
# OBSOLETE {.ch} "structure write 7"
# OBSOLETE }
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE set binfile "tests2.exe"
# 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 write_access
# OBSOLETE } else {
# OBSOLETE warning "$test_name tests suppressed."
# OBSOLETE }

View File

@ -1,161 +1,161 @@
# Copyright 1995, 1996 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "tuples"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
runto tuples.ch:40
gdb_test_exact "print v_arri" {= [(1): -1, (2): -2, (3): -3, (4): -4, (5): -5]}
gdb_test_exact "set v_arri := \[ 33, 44, 55, 66, 77 \]" {}
gdb_test_exact "print v_arri" {= [(1): 33, (2): 44, (3): 55, (4): 66, (5): 77]} "after assignment 1 to v_arri"
gdb_test_exact "set v_arri := \[-33, -44, -55, -66, -77\]" {}
gdb_test_exact "print v_arri" {= [(1): -33, (2): -44, (3): -55, (4): -66, (5): -77]} {after assignment 2 to v_arri}
gdb_test_exact "print v_arrui" {= [(1): 1, (2): 2, (3): 3, (4): 4, (5): 5]}
gdb_test_exact "set v_arrui := \[ 11, 11, 11, 11, 11 \]" {}
gdb_test_exact "print v_arrui" {= [(1:5): 11]} "after assignment to v_arrui"
gdb_test_exact "print v_arrb" {= [(1): -3, (2): -4, (3): -5, (4): -6, (5): -7]}
gdb_test_exact "set v_arrb := \[ -9, -8, -7, -6, -5 \]" {}
gdb_test_exact "print v_arrb" {= [(1): -9, (2): -8, (3): -7, (4): -6, (5): -5]} "after assignment to v_arrb"
gdb_test_exact "print v_arrub" {= [(1): 3, (2): 4, (3): 5, (4): 6, (5): 7]}
gdb_test_exact "set v_arrub := \[ 77, 77, 77, 77, 77 \]" {}
gdb_test_exact "print v_arrub" {= [(1:5): 77]} "v_arrub after assignment"
gdb_test_exact "print j" {= 4}
gdb_test_exact "print j := 3+4" {= 7}
gdb_test_exact "print j := r1(3)" {= 3}
gdb_test_exact "print v_arrc" {= [(1): '1', (2): '2', (3): '3', (4): '4', (5): '5']}
gdb_test_exact "set v_arrc := \[ 'a', 'b', 'c', 'd', 'e' \]" {}
gdb_test_exact "print v_arrc" {= [(1): 'a', (2): 'b', (3): 'c', (4): 'd', (5): 'e']} "v_arrc after assignment"
gdb_test_exact "print v_ps" {= [1, 3, 5]}
gdb_test_exact "set v_ps := \[ 2, 4 \]" {}
gdb_test_exact "print v_ps" {= [2, 4]} {v_ps after assignment}
gdb_test_exact "print v_ps := \[\]" {= []} {assign [] to v_ps}
gdb_test_exact "print m_arri\[1, 2, 3, 4, 5\]" {= [(1): 1, (2): 2, (3): 3, (4): 4, (5): 5]}
gdb_test_exact "print m_arrub\[45, 46, 47, 48, 49\]" {= [(1): 45, (2): 46, (3): 47, (4): 48, (5): 49]}
gdb_test_exact "print v_cv" {= "foo"}
gdb_test_exact "set v_cv := \"foo-bar\"" {}
gdb_test_exact "print v_cv" {= "foo-bar"} "v_cv after assignment"
gdb_test_exact "set v_cv(3) := ' '" {}
gdb_test_exact "print v_cv" {= "foo bar"} "v_cv after element assignment"
gdb_test_exact "print v_arrbool" {= [(1): TRUE, (2): FALSE, (3): TRUE, (4): FALSE, (5): TRUE]}
gdb_test_exact "set v_arrbool := \[ false, false, false, false, false \]" {}
gdb_test_exact "print v_arrbool" {= [(1:5): FALSE]} "v_arrbool after assignment 1"
gdb_test_exact "set v_arrbool := \[true, true, true, true, true\]" {}
gdb_test_exact "print v_arrbool" {= [(1:5): TRUE]} "v_arrbool after assignment 2"
gdb_test_exact "set v_arrbool(3) := false" {}
gdb_test_exact "print v_arrbool" {= [(1:2): TRUE, (3): FALSE, (4:5): TRUE]} "v_arrbool after element assignment"
gdb_test_exact "set v_arrbool(1 up 2) := \[ false, true \]" {}
gdb_test_exact "print v_arrbool" {= [(1): FALSE, (2): TRUE, (3): FALSE, (4:5): TRUE]} "v_arrbool after slice assignment 1"
gdb_test_exact "set v_arrbool(3 : 5) := \[ true, true, false \]" {}
gdb_test_exact "print v_arrbool" {= [(1): FALSE, (2:4): TRUE, (5): FALSE]} "v_arrbool after slice assignment 2"
gdb_test_exact "set vstr := \[ .a: 2+3, .b: 12, .ch1: 'x' \]" {}
gdb_test_exact "print vstr.a" {= 5} "vstr.a after assignment"
gdb_test_exact "print vstr.ch1" {= 'x'} "vstr.ch1 after assignment"
# These tests are from Cygnus PR chill/5024:
gdb_test "break printdow" ""
gdb_test "continue" ""
gdb_test_exact "set var w:= dow\[monday\]" {}
gdb_test "print w" " = \\\[monday\\\]" \
"print bitstring after assignment"
gdb_test_exact "set var w:=\[\]" {}
gdb_test "print w" " = \\\[\\\]" \
"print bitstring after assignment of \[\]"
# These tests are from Cygnus PR chill/8643:
runto tuples.ch:40
gdb_test_exact "set var vs1 := \[ \"foo\", 41, \[ b \] \]" {}
gdb_test_exact "print vs1" { = [.str: "foo", .i: 41, .ps: [b]]} \
"print vs1 after tuple assign 1"
setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
gdb_test_exact "set var vs1 := \[ \"bar\", 42, m_ps\[ a \] \]" {}
setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
gdb_test_exact "print vs1" { = [.str: "bar", .i: 42, .ps: [a]]} \
"print vs1 after tuple assign 2"
gdb_test_exact "set var \$i := m_s1\[\"foo\", 42, \[a \]\]" {}
gdb_test_exact {print $i} { = [.str: "foo", .i: 42, .ps: [a]]} \
"print \$i after tuple assign 1"
setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
gdb_test_exact "set var \$i := m_s1\[\"foo\", 44, m_ps\[a \]\]" {}
setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
gdb_test_exact {print $i} { = [.str: "foo", .i: 44, .ps: [a]]} \
"print \$i after tuple assign 2"
gdb_test_exact "set var vs2 := \[ 10, \[ \"foo\" , 42, \[ b \] \] \]" {}
gdb_test_exact "print vs2" \
{ = [.i: 10, .s: [.str: "foo", .i: 42, .ps: [b]]]} \
"print vs2 after tuple assign 1"
setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
gdb_test_exact "set var vs2 := \[ 10+3, m_s1\[ \"foo\" , 42, m_ps\[ b \] \] \]" {}
setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
gdb_test_exact "print vs2" \
{ = [.i: 13, .s: [.str: "foo", .i: 42, .ps: [b]]]} \
"print vs2 after tuple assign 2"
gdb_test_exact "set var vs3 := \[ 33, \[ -1, -2, -3 \] \]" {}
gdb_test_exact "print vs3" {[.i: 33, .a: [(1): -1, (2): -2, (3): -3]]} \
"print vs3 after tuple assign"
gdb_test_exact "set var \$k := m_s3\[ 33, m_arr\[ 4, 3, 2 \] \]" {}
gdb_test_exact {print $k} { = [.i: 33, .a: [(1): 4, (2): 3, (3): 2]]} \
"print \$k after tuple assign"
}
do_tests
# OBSOLETE # Copyright 1995, 1996 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile "tuples"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE runto tuples.ch:40
# OBSOLETE
# OBSOLETE gdb_test_exact "print v_arri" {= [(1): -1, (2): -2, (3): -3, (4): -4, (5): -5]}
# OBSOLETE gdb_test_exact "set v_arri := \[ 33, 44, 55, 66, 77 \]" {}
# OBSOLETE gdb_test_exact "print v_arri" {= [(1): 33, (2): 44, (3): 55, (4): 66, (5): 77]} "after assignment 1 to v_arri"
# OBSOLETE gdb_test_exact "set v_arri := \[-33, -44, -55, -66, -77\]" {}
# OBSOLETE gdb_test_exact "print v_arri" {= [(1): -33, (2): -44, (3): -55, (4): -66, (5): -77]} {after assignment 2 to v_arri}
# OBSOLETE
# OBSOLETE gdb_test_exact "print v_arrui" {= [(1): 1, (2): 2, (3): 3, (4): 4, (5): 5]}
# OBSOLETE gdb_test_exact "set v_arrui := \[ 11, 11, 11, 11, 11 \]" {}
# OBSOLETE gdb_test_exact "print v_arrui" {= [(1:5): 11]} "after assignment to v_arrui"
# OBSOLETE
# OBSOLETE gdb_test_exact "print v_arrb" {= [(1): -3, (2): -4, (3): -5, (4): -6, (5): -7]}
# OBSOLETE
# OBSOLETE gdb_test_exact "set v_arrb := \[ -9, -8, -7, -6, -5 \]" {}
# OBSOLETE gdb_test_exact "print v_arrb" {= [(1): -9, (2): -8, (3): -7, (4): -6, (5): -5]} "after assignment to v_arrb"
# OBSOLETE
# OBSOLETE gdb_test_exact "print v_arrub" {= [(1): 3, (2): 4, (3): 5, (4): 6, (5): 7]}
# OBSOLETE gdb_test_exact "set v_arrub := \[ 77, 77, 77, 77, 77 \]" {}
# OBSOLETE gdb_test_exact "print v_arrub" {= [(1:5): 77]} "v_arrub after assignment"
# OBSOLETE
# OBSOLETE gdb_test_exact "print j" {= 4}
# OBSOLETE gdb_test_exact "print j := 3+4" {= 7}
# OBSOLETE gdb_test_exact "print j := r1(3)" {= 3}
# OBSOLETE
# OBSOLETE gdb_test_exact "print v_arrc" {= [(1): '1', (2): '2', (3): '3', (4): '4', (5): '5']}
# OBSOLETE gdb_test_exact "set v_arrc := \[ 'a', 'b', 'c', 'd', 'e' \]" {}
# OBSOLETE gdb_test_exact "print v_arrc" {= [(1): 'a', (2): 'b', (3): 'c', (4): 'd', (5): 'e']} "v_arrc after assignment"
# OBSOLETE
# OBSOLETE gdb_test_exact "print v_ps" {= [1, 3, 5]}
# OBSOLETE gdb_test_exact "set v_ps := \[ 2, 4 \]" {}
# OBSOLETE gdb_test_exact "print v_ps" {= [2, 4]} {v_ps after assignment}
# OBSOLETE gdb_test_exact "print v_ps := \[\]" {= []} {assign [] to v_ps}
# OBSOLETE
# OBSOLETE gdb_test_exact "print m_arri\[1, 2, 3, 4, 5\]" {= [(1): 1, (2): 2, (3): 3, (4): 4, (5): 5]}
# OBSOLETE gdb_test_exact "print m_arrub\[45, 46, 47, 48, 49\]" {= [(1): 45, (2): 46, (3): 47, (4): 48, (5): 49]}
# OBSOLETE
# OBSOLETE gdb_test_exact "print v_cv" {= "foo"}
# OBSOLETE gdb_test_exact "set v_cv := \"foo-bar\"" {}
# OBSOLETE gdb_test_exact "print v_cv" {= "foo-bar"} "v_cv after assignment"
# OBSOLETE gdb_test_exact "set v_cv(3) := ' '" {}
# OBSOLETE gdb_test_exact "print v_cv" {= "foo bar"} "v_cv after element assignment"
# OBSOLETE
# OBSOLETE gdb_test_exact "print v_arrbool" {= [(1): TRUE, (2): FALSE, (3): TRUE, (4): FALSE, (5): TRUE]}
# OBSOLETE gdb_test_exact "set v_arrbool := \[ false, false, false, false, false \]" {}
# OBSOLETE gdb_test_exact "print v_arrbool" {= [(1:5): FALSE]} "v_arrbool after assignment 1"
# OBSOLETE gdb_test_exact "set v_arrbool := \[true, true, true, true, true\]" {}
# OBSOLETE gdb_test_exact "print v_arrbool" {= [(1:5): TRUE]} "v_arrbool after assignment 2"
# OBSOLETE gdb_test_exact "set v_arrbool(3) := false" {}
# OBSOLETE gdb_test_exact "print v_arrbool" {= [(1:2): TRUE, (3): FALSE, (4:5): TRUE]} "v_arrbool after element assignment"
# OBSOLETE
# OBSOLETE gdb_test_exact "set v_arrbool(1 up 2) := \[ false, true \]" {}
# OBSOLETE gdb_test_exact "print v_arrbool" {= [(1): FALSE, (2): TRUE, (3): FALSE, (4:5): TRUE]} "v_arrbool after slice assignment 1"
# OBSOLETE gdb_test_exact "set v_arrbool(3 : 5) := \[ true, true, false \]" {}
# OBSOLETE gdb_test_exact "print v_arrbool" {= [(1): FALSE, (2:4): TRUE, (5): FALSE]} "v_arrbool after slice assignment 2"
# OBSOLETE
# OBSOLETE gdb_test_exact "set vstr := \[ .a: 2+3, .b: 12, .ch1: 'x' \]" {}
# OBSOLETE gdb_test_exact "print vstr.a" {= 5} "vstr.a after assignment"
# OBSOLETE gdb_test_exact "print vstr.ch1" {= 'x'} "vstr.ch1 after assignment"
# OBSOLETE
# OBSOLETE # These tests are from Cygnus PR chill/5024:
# OBSOLETE gdb_test "break printdow" ""
# OBSOLETE gdb_test "continue" ""
# OBSOLETE gdb_test_exact "set var w:= dow\[monday\]" {}
# OBSOLETE gdb_test "print w" " = \\\[monday\\\]" \
# OBSOLETE "print bitstring after assignment"
# OBSOLETE gdb_test_exact "set var w:=\[\]" {}
# OBSOLETE gdb_test "print w" " = \\\[\\\]" \
# OBSOLETE "print bitstring after assignment of \[\]"
# OBSOLETE
# OBSOLETE # These tests are from Cygnus PR chill/8643:
# OBSOLETE runto tuples.ch:40
# OBSOLETE gdb_test_exact "set var vs1 := \[ \"foo\", 41, \[ b \] \]" {}
# OBSOLETE gdb_test_exact "print vs1" { = [.str: "foo", .i: 41, .ps: [b]]} \
# OBSOLETE "print vs1 after tuple assign 1"
# OBSOLETE setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
# OBSOLETE gdb_test_exact "set var vs1 := \[ \"bar\", 42, m_ps\[ a \] \]" {}
# OBSOLETE setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
# OBSOLETE gdb_test_exact "print vs1" { = [.str: "bar", .i: 42, .ps: [a]]} \
# OBSOLETE "print vs1 after tuple assign 2"
# OBSOLETE
# OBSOLETE gdb_test_exact "set var \$i := m_s1\[\"foo\", 42, \[a \]\]" {}
# OBSOLETE gdb_test_exact {print $i} { = [.str: "foo", .i: 42, .ps: [a]]} \
# OBSOLETE "print \$i after tuple assign 1"
# OBSOLETE setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
# OBSOLETE gdb_test_exact "set var \$i := m_s1\[\"foo\", 44, m_ps\[a \]\]" {}
# OBSOLETE setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
# OBSOLETE gdb_test_exact {print $i} { = [.str: "foo", .i: 44, .ps: [a]]} \
# OBSOLETE "print \$i after tuple assign 2"
# OBSOLETE
# OBSOLETE gdb_test_exact "set var vs2 := \[ 10, \[ \"foo\" , 42, \[ b \] \] \]" {}
# OBSOLETE gdb_test_exact "print vs2" \
# OBSOLETE { = [.i: 10, .s: [.str: "foo", .i: 42, .ps: [b]]]} \
# OBSOLETE "print vs2 after tuple assign 1"
# OBSOLETE setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
# OBSOLETE gdb_test_exact "set var vs2 := \[ 10+3, m_s1\[ \"foo\" , 42, m_ps\[ b \] \] \]" {}
# OBSOLETE setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
# OBSOLETE gdb_test_exact "print vs2" \
# OBSOLETE { = [.i: 13, .s: [.str: "foo", .i: 42, .ps: [b]]]} \
# OBSOLETE "print vs2 after tuple assign 2"
# OBSOLETE
# OBSOLETE gdb_test_exact "set var vs3 := \[ 33, \[ -1, -2, -3 \] \]" {}
# OBSOLETE gdb_test_exact "print vs3" {[.i: 33, .a: [(1): -1, (2): -2, (3): -3]]} \
# OBSOLETE "print vs3 after tuple assign"
# OBSOLETE gdb_test_exact "set var \$k := m_s3\[ 33, m_arr\[ 4, 3, 2 \] \]" {}
# OBSOLETE gdb_test_exact {print $k} { = [.i: 33, .a: [(1): 4, (2): 3, (3): 2]]} \
# OBSOLETE "print \$k after tuple assign"
# OBSOLETE
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests

View File

@ -1,66 +1,66 @@
# Copyright 1992, 1994, 1997, 1999 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 was written by Per Bothner. (bothner@cygnus.com)
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile2 "xstruct-grt"
set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
set objfile2 ${objdir}/$subdir/${testfile2}.o
if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
perror "Couldn't compile ${srcfile2}"
return -1
}
set testfile "xstruct"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
proc do_tests {} {
global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test "set language chill" ""
gdb_test "set var \$i := m_x\[\]" ""
gdb_test "print \$i" { = \[.i: 0, .ar: \[\(5:6\): \[.f1: 0, .f2: NULL, .f3: \[\(2:3\): 0\]\]\]\]}
gdb_test "set var \$j := m_y\[\]" ""
gdb_test "print \$j" { = \[.i: 0, .ar: \[\(7:8\): \[\(9:10\): \[.f1: 0, .f2: NULL, .f3: \[\(2:3\): 0\]\]\]\]\]}
}
do_tests
# OBSOLETE # Copyright 1992, 1994, 1997, 1999 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 was written by Per Bothner. (bothner@cygnus.com)
# OBSOLETE
# OBSOLETE if $tracelevel then {
# OBSOLETE strace $tracelevel
# OBSOLETE }
# OBSOLETE
# OBSOLETE if [skip_chill_tests] then { continue }
# OBSOLETE
# OBSOLETE set testfile2 "xstruct-grt"
# OBSOLETE set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
# OBSOLETE set objfile2 ${objdir}/$subdir/${testfile2}.o
# OBSOLETE if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile2}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE set testfile "xstruct"
# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch
# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe
# OBSOLETE if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
# OBSOLETE perror "Couldn't compile ${srcfile}"
# OBSOLETE return -1
# OBSOLETE }
# OBSOLETE
# OBSOLETE proc do_tests {} {
# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
# OBSOLETE
# OBSOLETE set prms_id 0
# OBSOLETE set bug_id 0
# OBSOLETE
# OBSOLETE # Start with a fresh gdb.
# OBSOLETE
# OBSOLETE gdb_exit
# OBSOLETE gdb_start
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
# OBSOLETE gdb_load $binfile
# OBSOLETE
# OBSOLETE gdb_test "set language chill" ""
# OBSOLETE
# OBSOLETE gdb_test "set var \$i := m_x\[\]" ""
# OBSOLETE gdb_test "print \$i" { = \[.i: 0, .ar: \[\(5:6\): \[.f1: 0, .f2: NULL, .f3: \[\(2:3\): 0\]\]\]\]}
# OBSOLETE
# OBSOLETE gdb_test "set var \$j := m_y\[\]" ""
# OBSOLETE gdb_test "print \$j" { = \[.i: 0, .ar: \[\(7:8\): \[\(9:10\): \[.f1: 0, .f2: NULL, .f3: \[\(2:3\): 0\]\]\]\]\]}
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests