OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [testsuite/] [gdb.chill/] [tests1.exp] - Diff between revs 107 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 107 Rev 1765
# Copyright (C) 1995, 1997 Free Software Foundation, Inc.
# Copyright (C) 1995, 1997 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# 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
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
# bug-gdb@prep.ai.mit.edu
# This file tests various Chill values, expressions, and types.
# This file tests various Chill values, expressions, and types.
if $tracelevel then {
if $tracelevel then {
        strace $tracelevel
        strace $tracelevel
}
}
if [skip_chill_tests] then { continue }
if [skip_chill_tests] then { continue }
set testfile "tests1"
set testfile "tests1"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
set binfile ${objdir}/${subdir}/${testfile}.exe
if  { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
if  { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
    perror "Couldn't compile ${srcfile}"
    perror "Couldn't compile ${srcfile}"
    return -1
    return -1
}
}
# Set the current language to chill.  This counts as a test.  If it
# Set the current language to chill.  This counts as a test.  If it
# fails, then we skip the other tests.
# fails, then we skip the other tests.
proc set_lang_chill {} {
proc set_lang_chill {} {
    global gdb_prompt
    global gdb_prompt
    global binfile objdir subdir
    global binfile objdir subdir
    verbose "loading file '$binfile'"
    verbose "loading file '$binfile'"
    gdb_load $binfile
    gdb_load $binfile
    send_gdb "set language chill\n"
    send_gdb "set language chill\n"
    gdb_expect {
    gdb_expect {
        -re ".*$gdb_prompt $" {}
        -re ".*$gdb_prompt $" {}
        timeout { fail "set language chill (timeout)" ; return 0 }
        timeout { fail "set language chill (timeout)" ; return 0 }
    }
    }
    send_gdb "show language\n"
    send_gdb "show language\n"
    gdb_expect {
    gdb_expect {
        -re ".* source language is \"chill\".*$gdb_prompt $" {
        -re ".* source language is \"chill\".*$gdb_prompt $" {
            pass "set language to \"chill\""
            pass "set language to \"chill\""
            send_gdb "break dummyfunc\n"
            send_gdb "break dummyfunc\n"
            gdb_expect {
            gdb_expect {
                -re ".*$gdb_prompt $" {
                -re ".*$gdb_prompt $" {
                    send_gdb "run\n"
                    send_gdb "run\n"
                    gdb_expect -re ".*$gdb_prompt $" {}
                    gdb_expect -re ".*$gdb_prompt $" {}
                    return 1
                    return 1
                }
                }
                timeout {
                timeout {
                    fail "can't set breakpoint (timeout)"
                    fail "can't set breakpoint (timeout)"
                    return 0
                    return 0
                }
                }
            }
            }
        }
        }
        -re ".*$gdb_prompt $" {
        -re ".*$gdb_prompt $" {
            fail "setting language to \"chill\""
            fail "setting language to \"chill\""
            return 0
            return 0
        }
        }
        timeout {
        timeout {
            fail "can't show language (timeout)"
            fail "can't show language (timeout)"
            return 0
            return 0
        }
        }
    }
    }
}
}
# Testing printing of a specific value.  Increment passcount for
# Testing printing of a specific value.  Increment passcount for
# success or issue fail message for failure.  In both cases, return
# success or issue fail message for failure.  In both cases, return
# a 1 to indicate that more tests can proceed.  However a timeout
# a 1 to indicate that more tests can proceed.  However a timeout
# is a serious error, generates a special fail message, and causes
# 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
# a 0 to be returned to indicate that more tests are likely to fail
# as well.
# as well.
#
#
# Args are:
# Args are:
#
#
#       First one is string to send_gdb to gdb
#       First one is string to send_gdb to gdb
#       Second one is string to match gdb result to
#       Second one is string to match gdb result to
#       Third one is an optional message to be printed
#       Third one is an optional message to be printed
proc test_print_accept { args } {
proc test_print_accept { args } {
    global gdb_prompt
    global gdb_prompt
    global passcount
    global passcount
    global verbose
    global verbose
    if [llength $args]==3 then {
    if [llength $args]==3 then {
        set message [lindex $args 2]
        set message [lindex $args 2]
    } else {
    } else {
        set message [lindex $args 0]
        set message [lindex $args 0]
    }
    }
    set sendthis [lindex $args 0]
    set sendthis [lindex $args 0]
    set expectthis [lindex $args 1]
    set expectthis [lindex $args 1]
    set result [gdb_test $sendthis ".* = ${expectthis}" $message]
    set result [gdb_test $sendthis ".* = ${expectthis}" $message]
    if $result==0 {incr passcount}
    if $result==0 {incr passcount}
    return $result
    return $result
}
}
# Testing printing of a specific value.  Increment passcount for
# Testing printing of a specific value.  Increment passcount for
# success or issue fail message for failure.  In both cases, return
# success or issue fail message for failure.  In both cases, return
# a 1 to indicate that more tests can proceed.  However a timeout
# a 1 to indicate that more tests can proceed.  However a timeout
# is a serious error, generates a special fail message, and causes
# 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
# a 0 to be returned to indicate that more tests are likely to fail
# as well.
# as well.
# various tests if modes are treated correctly
# various tests if modes are treated correctly
# using ptype
# using ptype
proc test_modes {} {
proc test_modes {} {
    global passcount
    global passcount
    verbose "testing chill modes"
    verbose "testing chill modes"
    set passcount 0
    set passcount 0
    # discrete modes
    # discrete modes
    test_print_accept "ptype BYTE" "byte"
    test_print_accept "ptype BYTE" "byte"
    test_print_accept "ptype UBYTE" "ubyte"
    test_print_accept "ptype UBYTE" "ubyte"
    test_print_accept "ptype INT" "int"
    test_print_accept "ptype INT" "int"
    test_print_accept "ptype UINT" "uint"
    test_print_accept "ptype UINT" "uint"
    test_print_accept "ptype LONG" "long"
    test_print_accept "ptype LONG" "long"
    test_print_accept "ptype ULONG" "ulong"
    test_print_accept "ptype ULONG" "ulong"
    test_print_accept "ptype BOOL" "bool"
    test_print_accept "ptype BOOL" "bool"
    test_print_accept "ptype CHAR" "char"
    test_print_accept "ptype CHAR" "char"
    test_print_accept "ptype set1" "SET \[(\]aaa, bbb, ccc\[)\]" \
    test_print_accept "ptype set1" "SET \[(\]aaa, bbb, ccc\[)\]" \
        "print unnumbered set mode"
        "print unnumbered set mode"
    test_print_accept "ptype nset1" "SET \[(\]na = 1, nb = 34, nc = 20\[)\]" \
    test_print_accept "ptype nset1" "SET \[(\]na = 1, nb = 34, nc = 20\[)\]" \
        "print numbered set mode"
        "print numbered set mode"
    # mp:
    # mp:
    # display maybe in hex values ?
    # display maybe in hex values ?
    #
    #
    test_print_accept "ptype r11" "ubyte \\(0:255\\)" \
    test_print_accept "ptype r11" "ubyte \\(0:255\\)" \
        "print ubyte range mode"
        "print ubyte range mode"
    test_print_accept "ptype r12" "uint \\(0:65535\\)" \
    test_print_accept "ptype r12" "uint \\(0:65535\\)" \
        "print uint range mode"
        "print uint range mode"
#    test_print_accept "ptype r13" "ulong \\(0:4294967295\\)" \
#    test_print_accept "ptype r13" "ulong \\(0:4294967295\\)" \
#       "print ulong range mode"
#       "print ulong range mode"
    test_print_accept "ptype r14" "byte \\(-128:127\\)" \
    test_print_accept "ptype r14" "byte \\(-128:127\\)" \
        "print byte range mode"
        "print byte range mode"
    test_print_accept "ptype r15" "int \\(-32768:32767\\)" \
    test_print_accept "ptype r15" "int \\(-32768:32767\\)" \
        "print int range mode"
        "print int range mode"
    test_print_accept "ptype r16" "long \\(-2147483648:2147483647\\)" \
    test_print_accept "ptype r16" "long \\(-2147483648:2147483647\\)" \
        "print long range mode"
        "print long range mode"
    test_print_accept "ptype r2" "set1 \\(bbb:ccc\\)" \
    test_print_accept "ptype r2" "set1 \\(bbb:ccc\\)" \
        "print unnumbered set range mode"
        "print unnumbered set range mode"
    test_print_accept "ptype r3" "nset1 \\(na:na\\)" \
    test_print_accept "ptype r3" "nset1 \\(na:na\\)" \
        "print numbered set range mode"
        "print numbered set range mode"
    # really this order ?
    # really this order ?
    # I'm not sure what should happen for the next two tests.
    # I'm not sure what should happen for the next two tests.
    setup_xfail "*-*-*"
    setup_xfail "*-*-*"
    test_print_accept "ptype r4" "nset1 \\(nb = 34:nc = 20\\)" \
    test_print_accept "ptype r4" "nset1 \\(nb = 34:nc = 20\\)" \
        "print numbered set range mode"
        "print numbered set range mode"
    setup_xfail "*-*-*"
    setup_xfail "*-*-*"
    test_print_accept "ptype r5" "nset1 \\(na = 1, nb = 34, nc = 20\\)" \
    test_print_accept "ptype r5" "nset1 \\(na = 1, nb = 34, nc = 20\\)" \
        "print numbered set range mode"
        "print numbered set range mode"
    # powerset modes
    # powerset modes
    test_print_accept "ptype pm1" \
    test_print_accept "ptype pm1" \
        "POWERSET SET \[(\]p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\[)\]" \
        "POWERSET SET \[(\]p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\[)\]" \
        "print powerset mode 1"
        "print powerset mode 1"
    test_print_accept "ptype pm2" "POWERSET byte \\(1:8\\)" \
    test_print_accept "ptype pm2" "POWERSET byte \\(1:8\\)" \
        "print powerset mode 2"
        "print powerset mode 2"
    test_print_accept "ptype pm3" "POWERSET int \\(-32768:32767\\)" \
    test_print_accept "ptype pm3" "POWERSET int \\(-32768:32767\\)" \
        "print powerset mode 3"
        "print powerset mode 3"
    test_print_accept "ptype pm4" "POWERSET long \\(-32768:32768\\)" \
    test_print_accept "ptype pm4" "POWERSET long \\(-32768:32768\\)" \
        "print powerset mode 4"
        "print powerset mode 4"
    test_print_accept "ptype pm5" \
    test_print_accept "ptype pm5" \
        "POWERSET long \\(-2147483648:2147483647\\)" \
        "POWERSET long \\(-2147483648:2147483647\\)" \
        "print powerset mode 5"
        "print powerset mode 5"
    # reference modes
    # reference modes
    test_print_accept "ptype ref1" "REF pm1" \
    test_print_accept "ptype ref1" "REF pm1" \
        "print reference to powerset mode"
        "print reference to powerset mode"
    test_print_accept "ptype ref2" "REF byte" \
    test_print_accept "ptype ref2" "REF byte" \
        "print reference to byte"
        "print reference to byte"
    test_print_accept "ptype ref3" "PTR" \
    test_print_accept "ptype ref3" "PTR" \
        "print free reference type"
        "print free reference type"
    # procedure modes
    # procedure modes
    # FIXME: we have to talk about this ...
    # FIXME: we have to talk about this ...
    test_print_accept "ptype prm1" \
    test_print_accept "ptype prm1" \
        "REF PROC \[(\]\[)\]" \
        "REF PROC \[(\]\[)\]" \
        "print procedure mode 1"
        "print procedure mode 1"
    setup_xfail "*-*-*"
    setup_xfail "*-*-*"
    test_print_accept "ptype prm2" \
    test_print_accept "ptype prm2" \
        "REF PROC \[(\]bool in, int out long inout\[)\] RETURNS \[(\]char\[)\]" \
        "REF PROC \[(\]bool in, int out long inout\[)\] RETURNS \[(\]char\[)\]" \
        "print procedure mode 2"
        "print procedure mode 2"
    setup_xfail "*-*-*"
    setup_xfail "*-*-*"
    test_print_accept "ptype prm3" \
    test_print_accept "ptype prm3" \
        "REF PROC \[(\]pm1, ref loc\[)\] RETURNS \[(\]ref3\[)\]" \
        "REF PROC \[(\]pm1, ref loc\[)\] RETURNS \[(\]ref3\[)\]" \
        "print procedure mode 3"
        "print procedure mode 3"
    setup_xfail "*-*-*"
    setup_xfail "*-*-*"
    test_print_accept "ptype prm4" \
    test_print_accept "ptype prm4" \
        "\[(\] \[)\] EXCEPTIONS \[(\]ex1, ex2, ex3\[)\]" \
        "\[(\] \[)\] EXCEPTIONS \[(\]ex1, ex2, ex3\[)\]" \
        "print procedure mode 4"
        "print procedure mode 4"
    setup_xfail "*-*-*"
    setup_xfail "*-*-*"
    test_print_accept "ptype prm5" \
    test_print_accept "ptype prm5" \
        "REF PROC \[(\]r11, r16 inout, r5 out\[)\] RETURNS \[(\]r2\[)\] EXCEPTIONS \[(\]ex1\[)\]" \
        "REF PROC \[(\]r11, r16 inout, r5 out\[)\] RETURNS \[(\]r2\[)\] EXCEPTIONS \[(\]ex1\[)\]" \
        "print procedure mode 5"
        "print procedure mode 5"
    # synchronization modes
    # synchronization modes
    # FIXME: since gdb doesn't process events & buffers so far, this has be
    # FIXME: since gdb doesn't process events & buffers so far, this has be
    #        filled later...
    #        filled later...
    xfail "synchronization mode handling"
    xfail "synchronization mode handling"
    # timing modes
    # timing modes
    test_print_accept "ptype DURATION" "duration"
    test_print_accept "ptype DURATION" "duration"
    test_print_accept "ptype TIME" "time"
    test_print_accept "ptype TIME" "time"
    # string modes
    # string modes
    # some tests are done in chillvars.exp
    # some tests are done in chillvars.exp
    test_print_accept "ptype strm1" "CHARS \\(5\\)" "print char string mode"
    test_print_accept "ptype strm1" "CHARS \\(5\\)" "print char string mode"
    test_print_accept "ptype strm2" "CHARS \[(\]7\[)\] VARYING" \
    test_print_accept "ptype strm2" "CHARS \[(\]7\[)\] VARYING" \
        "print varying char string mode"
        "print varying char string mode"
    test_print_accept "ptype bstr1" "BOOLS \\(20\\)" "print bit string mode"
    test_print_accept "ptype bstr1" "BOOLS \\(20\\)" "print bit string mode"
    test_print_accept "ptype B'000'" "BOOLS \\(3\\)" "bit string literal"
    test_print_accept "ptype B'000'" "BOOLS \\(3\\)" "bit string literal"
    test_print_accept "ptype B'11110000'" "BOOLS \\(8\\)" "bit string literal"
    test_print_accept "ptype B'11110000'" "BOOLS \\(8\\)" "bit string literal"
    # FIXME: adjust error message
    # FIXME: adjust error message
    gdb_test "ptype B'00110211'" {.*Too-large digit.*[.]} \
    gdb_test "ptype B'00110211'" {.*Too-large digit.*[.]} \
        "reject invalid bitstring"
        "reject invalid bitstring"
    # array modes
    # array modes
    # some tests are done in chillvars.exp
    # some tests are done in chillvars.exp
    test_print_accept "ptype arr1m" "ARRAY \\(1:100\\) set1" \
    test_print_accept "ptype arr1m" "ARRAY \\(1:100\\) set1" \
        "print array mode 1"
        "print array mode 1"
    test_print_accept "ptype arr2m" "ARRAY \\(1:100\\) ARRAY \\(1:100\\) set1"\
    test_print_accept "ptype arr2m" "ARRAY \\(1:100\\) ARRAY \\(1:100\\) set1"\
        "print array mode 2"
        "print array mode 2"
    test_print_accept "ptype arr3m" "ARRAY \\(0:255\\) ARRAY \\(0:65535\\) ARRAY \\(-128:127\\) set1" \
    test_print_accept "ptype arr3m" "ARRAY \\(0:255\\) ARRAY \\(0:65535\\) ARRAY \\(-128:127\\) set1" \
        "print array mode 3"
        "print array mode 3"
    setup_xfail "*-*-*"
    setup_xfail "*-*-*"
    test_print_accept "ptype arr4m" "ARRAY \\(b:c\\) ARRAY \\(na = 1:na = 1\\) ARRAY \\(nc:nb\\) ARRAY \\(na = 1:nc = 20\\) POWERSET SET \[(\]p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\[)\]" \
    test_print_accept "ptype arr4m" "ARRAY \\(b:c\\) ARRAY \\(na = 1:na = 1\\) ARRAY \\(nc:nb\\) ARRAY \\(na = 1:nc = 20\\) POWERSET SET \[(\]p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\[)\]" \
        "print array mode 4"
        "print array mode 4"
    # structure modes
    # structure modes
    # some checks are in chillvars.exp
    # some checks are in chillvars.exp
    # setup_xfail "*-*-*"
    # setup_xfail "*-*-*"
    test_print_accept "ptype stru1m" "STRUCT \\(.*a long,.*b long,.*CASE OF.*:.*ch1 CHARS \\(20\\).*:.*ch2 CHARS \\(10\\).*ELSE.*ch3 CHARS \\(1\\).*ESAC.*\\)" \
    test_print_accept "ptype stru1m" "STRUCT \\(.*a long,.*b long,.*CASE OF.*:.*ch1 CHARS \\(20\\).*:.*ch2 CHARS \\(10\\).*ELSE.*ch3 CHARS \\(1\\).*ESAC.*\\)" \
        "print structure mode 1"
        "print structure mode 1"
    #setup_xfail "*-*-*"
    #setup_xfail "*-*-*"
    test_print_accept "ptype stru2m" "STRUCT \\(.*f set1,.*CASE OF.*:.*ch1 CHARS \\(20\\).*:.*ch2 CHARS \\(10\\) VARYING.*ELSE.*ch3 CHARS \\(0\\) VARYING.*ESAC.*\\)" \
    test_print_accept "ptype stru2m" "STRUCT \\(.*f set1,.*CASE OF.*:.*ch1 CHARS \\(20\\).*:.*ch2 CHARS \\(10\\) VARYING.*ELSE.*ch3 CHARS \\(0\\) VARYING.*ESAC.*\\)" \
        "print structure mode 2"
        "print structure mode 2"
    #setup_xfail "*-*-*"
    #setup_xfail "*-*-*"
    test_print_accept "ptype stru3m" "STRUCT \\(.*f r3,.*CASE OF.*:.*ch1 CHARS \\(20\\).*ESAC.*\\)" \
    test_print_accept "ptype stru3m" "STRUCT \\(.*f r3,.*CASE OF.*:.*ch1 CHARS \\(20\\).*ESAC.*\\)" \
        "print structure mode 3"
        "print structure mode 3"
    # setup_xfail "*-*-*"
    # setup_xfail "*-*-*"
    test_print_accept "ptype stru4m" "STRUCT \\(.*i long,.*CASE OF.*:.*i1 int,.*i11 int,.*b1 bool,.*c1 char.*:.*i2 long,.*i22 long,.*bs2 BOOLS \\(10\\).*:.*s3 STRUCT \\(.*i3 int,.*CASE OF.*:.*foo long.*ELSE.*bar char.*ESAC.*\\).*ELSE.*x stru2m.*ESAC,.*y stru3m.*\\)" \
    test_print_accept "ptype stru4m" "STRUCT \\(.*i long,.*CASE OF.*:.*i1 int,.*i11 int,.*b1 bool,.*c1 char.*:.*i2 long,.*i22 long,.*bs2 BOOLS \\(10\\).*:.*s3 STRUCT \\(.*i3 int,.*CASE OF.*:.*foo long.*ELSE.*bar char.*ESAC.*\\).*ELSE.*x stru2m.*ESAC,.*y stru3m.*\\)" \
        "print structure mode 4"
        "print structure mode 4"
    if $passcount then {
    if $passcount then {
        pass "$passcount correct modes printed"
        pass "$passcount correct modes printed"
    }
    }
}
}
# various tests if locations are treated correctly
# various tests if locations are treated correctly
# read access using ptype, print, whatis
# read access using ptype, print, whatis
proc test_locations {} {
proc test_locations {} {
    global passcount
    global passcount
    set passcount 0
    set passcount 0
    verbose "testing read access to locations"
    verbose "testing read access to locations"
    # various location tests can be found in chillvars.exp
    # various location tests can be found in chillvars.exp
    # set locations
    # set locations
    test_print_accept "ptype s1l" "SET \\(aaa, bbb, ccc\\)" \
    test_print_accept "ptype s1l" "SET \\(aaa, bbb, ccc\\)" \
        "print mode of set location"
        "print mode of set location"
    test_print_accept "whatis s1l" "set1" \
    test_print_accept "whatis s1l" "set1" \
        "print modename of set location"
        "print modename of set location"
    test_print_accept "print s1l" "ccc" "print set location"
    test_print_accept "print s1l" "ccc" "print set location"
    test_print_accept "ptype s2l" "SET \\(na = 1, nb = 34, nc = 20\\)" \
    test_print_accept "ptype s2l" "SET \\(na = 1, nb = 34, nc = 20\\)" \
        "print mode of numbered set location"
        "print mode of numbered set location"
    test_print_accept "whatis s2l" "nset1" \
    test_print_accept "whatis s2l" "nset1" \
        "print mode name of numbered set location"
        "print mode name of numbered set location"
    test_print_accept "print s2l" "nb" "print numberes set location"
    test_print_accept "print s2l" "nb" "print numberes set location"
    # range modes
    # range modes
    test_print_accept "ptype rl1" "ubyte \\(0:255\\)" \
    test_print_accept "ptype rl1" "ubyte \\(0:255\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl1" "r11" \
    test_print_accept "whatis rl1" "r11" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl1" "3" \
    test_print_accept "print rl1" "3" \
        "print range location"
        "print range location"
    test_print_accept "ptype rl2" "ubyte \\(0:255\\)" \
    test_print_accept "ptype rl2" "ubyte \\(0:255\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl2" "r11" \
    test_print_accept "whatis rl2" "r11" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl2" "0" \
    test_print_accept "print rl2" "0" \
        "print range location"
        "print range location"
    test_print_accept "ptype rl3" "ubyte \\(0:255\\)" \
    test_print_accept "ptype rl3" "ubyte \\(0:255\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl3" "r11" \
    test_print_accept "whatis rl3" "r11" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl3" "255" \
    test_print_accept "print rl3" "255" \
        "print range location"
        "print range location"
    test_print_accept "ptype rl5" "uint \\(0:65535\\)" \
    test_print_accept "ptype rl5" "uint \\(0:65535\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl5" "r12" \
    test_print_accept "whatis rl5" "r12" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl5" "65530" \
    test_print_accept "print rl5" "65530" \
        "print range location"
        "print range location"
    test_print_accept "ptype rl6" "uint \\(0:65535\\)" \
    test_print_accept "ptype rl6" "uint \\(0:65535\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl6" "r12" \
    test_print_accept "whatis rl6" "r12" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl6" "0" \
    test_print_accept "print rl6" "0" \
        "print range location"
        "print range location"
    test_print_accept "ptype rl7" "uint \\(0:65535\\)" \
    test_print_accept "ptype rl7" "uint \\(0:65535\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl7" "r12" \
    test_print_accept "whatis rl7" "r12" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl7" "65535" \
    test_print_accept "print rl7" "65535" \
        "print range location"
        "print range location"
#     test_print_accept "ptype rl9" "ulong \\(0:4294967295\\)" \
#     test_print_accept "ptype rl9" "ulong \\(0:4294967295\\)" \
#       "print mode of range location"
#       "print mode of range location"
#     test_print_accept "whatis rl9" "r13" \
#     test_print_accept "whatis rl9" "r13" \
#       "print mode name of range location"
#       "print mode name of range location"
#     test_print_accept "print rl9" "128" \
#     test_print_accept "print rl9" "128" \
#       "print range location"
#       "print range location"
#     test_print_accept "ptype rl10" "ulong \\(0:4294967295\\)" \
#     test_print_accept "ptype rl10" "ulong \\(0:4294967295\\)" \
#       "print mode of range location"
#       "print mode of range location"
#     test_print_accept "whatis rl10" "r13" \
#     test_print_accept "whatis rl10" "r13" \
#       "print mode name of range location"
#       "print mode name of range location"
#     test_print_accept "print rl10" "0" \
#     test_print_accept "print rl10" "0" \
#       "print range location"
#       "print range location"
#     test_print_accept "ptype rl11" "ulong \\(0:4294967295\\)" \
#     test_print_accept "ptype rl11" "ulong \\(0:4294967295\\)" \
#       "print mode of range location"
#       "print mode of range location"
#     test_print_accept "whatis rl11" "r13" \
#     test_print_accept "whatis rl11" "r13" \
#       "print mode name of range location"
#       "print mode name of range location"
#     test_print_accept "print rl11" "4294967295" \
#     test_print_accept "print rl11" "4294967295" \
#       "print range location"
#       "print range location"
    test_print_accept "ptype rl13" "byte \\(-128:127\\)" \
    test_print_accept "ptype rl13" "byte \\(-128:127\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl13" "r14" \
    test_print_accept "whatis rl13" "r14" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl13" "-121" \
    test_print_accept "print rl13" "-121" \
        "print range location"
        "print range location"
    test_print_accept "ptype rl14" "byte \\(-128:127\\)" \
    test_print_accept "ptype rl14" "byte \\(-128:127\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl14" "r14" \
    test_print_accept "whatis rl14" "r14" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl14" "-128" \
    test_print_accept "print rl14" "-128" \
        "print range location"
        "print range location"
    test_print_accept "ptype rl15" "byte \\(-128:127\\)" \
    test_print_accept "ptype rl15" "byte \\(-128:127\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl15" "r14" \
    test_print_accept "whatis rl15" "r14" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl15" "127" \
    test_print_accept "print rl15" "127" \
        "print range location"
        "print range location"
    test_print_accept "ptype rl17" "int \\(-32768:32767\\)" \
    test_print_accept "ptype rl17" "int \\(-32768:32767\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl17" "r15" \
    test_print_accept "whatis rl17" "r15" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl17" "-32720" \
    test_print_accept "print rl17" "-32720" \
        "print range location"
        "print range location"
    test_print_accept "ptype rl18" "int \\(-32768:32767\\)" \
    test_print_accept "ptype rl18" "int \\(-32768:32767\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl18" "r15" \
    test_print_accept "whatis rl18" "r15" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl18" "-32768" \
    test_print_accept "print rl18" "-32768" \
        "print range location"
        "print range location"
    test_print_accept "ptype rl19" "int \\(-32768:32767\\)" \
    test_print_accept "ptype rl19" "int \\(-32768:32767\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl19" "r15" \
    test_print_accept "whatis rl19" "r15" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl19" "32767" \
    test_print_accept "print rl19" "32767" \
        "print range location"
        "print range location"
    test_print_accept "ptype rl21" "long \\(-2147483648:2147483647\\)" \
    test_print_accept "ptype rl21" "long \\(-2147483648:2147483647\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl21" "r16" \
    test_print_accept "whatis rl21" "r16" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl21" "2147483643" \
    test_print_accept "print rl21" "2147483643" \
        "print range location"
        "print range location"
    test_print_accept "ptype rl22" "long \\(-2147483648:2147483647\\)" \
    test_print_accept "ptype rl22" "long \\(-2147483648:2147483647\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl22" "r16" \
    test_print_accept "whatis rl22" "r16" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl22" "-2147483648" \
    test_print_accept "print rl22" "-2147483648" \
        "print range location"
        "print range location"
    test_print_accept "ptype rl23" "long \\(-2147483648:2147483647\\)" \
    test_print_accept "ptype rl23" "long \\(-2147483648:2147483647\\)" \
        "print mode of range location"
        "print mode of range location"
    test_print_accept "whatis rl23" "r16" \
    test_print_accept "whatis rl23" "r16" \
        "print mode name of range location"
        "print mode name of range location"
    test_print_accept "print rl23" "2147483647" \
    test_print_accept "print rl23" "2147483647" \
        "print range location"
        "print range location"
    # powerset locations
    # powerset locations
    test_print_accept "ptype pl1" \
    test_print_accept "ptype pl1" \
        "POWERSET SET \\(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\\)" \
        "POWERSET SET \\(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\\)" \
        "print mode of powerset location 1"
        "print mode of powerset location 1"
    test_print_accept "whatis pl1" "pm1" \
    test_print_accept "whatis pl1" "pm1" \
        "print mode mode name of powerset location"
        "print mode mode name of powerset location"
    test_print_accept "print pl1" \
    test_print_accept "print pl1" \
        "\[\[\]p1:p10\[\]\]" \
        "\[\[\]p1:p10\[\]\]" \
        "print powerset location 1"
        "print powerset location 1"
    test_print_accept "print pl2" {\[\]} \
    test_print_accept "print pl2" {\[\]} \
        "print powerset location 2"
        "print powerset location 2"
    test_print_accept "print pl3" "\[\[\]p1, p10\[\]\]" \
    test_print_accept "print pl3" "\[\[\]p1, p10\[\]\]" \
        "print powerset location 3"
        "print powerset location 3"
    test_print_accept "print pl4" {\[p1:p2, p4:p6, p8:p10\]} \
    test_print_accept "print pl4" {\[p1:p2, p4:p6, p8:p10\]} \
        "print powerset location 4"
        "print powerset location 4"
    test_print_accept "print pl5" {\[p1:p4, p6, p8:p10\]} \
    test_print_accept "print pl5" {\[p1:p4, p6, p8:p10\]} \
        "print powerset location 5"
        "print powerset location 5"
    test_print_accept "print pl6" {\[p1, p3:p8, p10\]} \
    test_print_accept "print pl6" {\[p1, p3:p8, p10\]} \
        "print powerset location 6"
        "print powerset location 6"
    test_print_accept "ptype pl7" \
    test_print_accept "ptype pl7" \
        "POWERSET byte \\(1:8\\)" \
        "POWERSET byte \\(1:8\\)" \
        "print mode of byte powerset location"
        "print mode of byte powerset location"
    test_print_accept "whatis pl7" "pm2" \
    test_print_accept "whatis pl7" "pm2" \
        "print modename of byte powerset location"
        "print modename of byte powerset location"
    test_print_accept "print pl7" {\[1:8\]} \
    test_print_accept "print pl7" {\[1:8\]} \
        "print powerset location 7"
        "print powerset location 7"
    test_print_accept "ptype pl8" \
    test_print_accept "ptype pl8" \
        "POWERSET int \\(-32768:32767\\)" \
        "POWERSET int \\(-32768:32767\\)" \
        "print mode of int powerset location"
        "print mode of int powerset location"
    test_print_accept "whatis pl8" "pm3" \
    test_print_accept "whatis pl8" "pm3" \
        "print modename of int powerset location"
        "print modename of int powerset location"
    test_print_accept "print pl8" {\[-32768:32767\]} \
    test_print_accept "print pl8" {\[-32768:32767\]} \
        "print powerset location 8"
        "print powerset location 8"
#    test_print_accept "ptype pl9" \
#    test_print_accept "ptype pl9" \
#       "POWERSET long \\(-2147483648:2147483647\\)" \
#       "POWERSET long \\(-2147483648:2147483647\\)" \
#       "print mode of long powerset location"
#       "print mode of long powerset location"
#    test_print_accept "whatis pl9" "pm5" \
#    test_print_accept "whatis pl9" "pm5" \
#       "print modename of long powerset location"
#       "print modename of long powerset location"
#    test_print_accept "print pl9" {\[-2147483648:2147483647\]} \
#    test_print_accept "print pl9" {\[-2147483648:2147483647\]} \
#       "print powerset location 9"
#       "print powerset location 9"
    # reference modes
    # reference modes
    test_print_accept "ptype ref3l" "PTR" "print mode of reference location"
    test_print_accept "ptype ref3l" "PTR" "print mode of reference location"
    # setup_xfail "*-*-*"
    # setup_xfail "*-*-*"
    test_print_accept "whatis ref3l" "ref3" \
    test_print_accept "whatis ref3l" "ref3" \
        "print modename of reference location"
        "print modename of reference location"
    # setup_xfail "*-*-*"
    # setup_xfail "*-*-*"
    test_print_accept "print ref3l" "ref3\\(H'.*\\)" \
    test_print_accept "print ref3l" "ref3\\(H'.*\\)" \
        "print reference location"
        "print reference location"
    test_print_accept "ptype ref4l" "PTR" "print mode of reference location"
    test_print_accept "ptype ref4l" "PTR" "print mode of reference location"
    # setup_xfail "*-*-*"
    # setup_xfail "*-*-*"
    test_print_accept "whatis ref4l" "ref4" \
    test_print_accept "whatis ref4l" "ref4" \
        "print modename of reference location"
        "print modename of reference location"
    # setup_xfail "*-*-*"
    # setup_xfail "*-*-*"
    test_print_accept "print ref4l" "ref4\\(H'.*\\)" \
    test_print_accept "print ref4l" "ref4\\(H'.*\\)" \
        "print reference location"
        "print reference location"
    test_print_accept "ptype ref5l" "PTR" "print mode of reference location"
    test_print_accept "ptype ref5l" "PTR" "print mode of reference location"
    test_print_accept "whatis ref5l" "PTR" \
    test_print_accept "whatis ref5l" "PTR" \
        "print modename of reference location"
        "print modename of reference location"
    test_print_accept "print ref5l" "PTR\\(H'.*\\)" \
    test_print_accept "print ref5l" "PTR\\(H'.*\\)" \
        "print reference location"
        "print reference location"
    # dereference a little bit..
    # dereference a little bit..
    test_print_accept "print ref6l->syn_int" "42" \
    test_print_accept "print ref6l->syn_int" "42" \
        "dereference reference to synmode location"
        "dereference reference to synmode location"
    test_print_accept "print ref7l->int" "-42" \
    test_print_accept "print ref7l->int" "-42" \
        "dereference reference to predefined mode location"
        "dereference reference to predefined mode location"
    test_print_accept "print ref8l->pm1" \
    test_print_accept "print ref8l->pm1" \
        "\[\[\]p1:p10\[\]\]" \
        "\[\[\]p1:p10\[\]\]" \
        "dereference reference to newmode location"
        "dereference reference to newmode location"
    # synchronization mode locations
    # synchronization mode locations
    # FIXME: synchronization modes are not supported so far...
    # FIXME: synchronization modes are not supported so far...
    xfail "no synchronization mode location support, not implemented yet"
    xfail "no synchronization mode location support, not implemented yet"
    # timing mode locations
    # timing mode locations
    # FIXME: callbacks to abstime, inttime not implemented
    # FIXME: callbacks to abstime, inttime not implemented
    xfail "timing modes not implemented properly yet"
    xfail "timing modes not implemented properly yet"
    # char string locations
    # char string locations
    # some tests are don in chillvars.exp
    # some tests are don in chillvars.exp
    test_print_accept "ptype strl1" \
    test_print_accept "ptype strl1" \
        "CHARS \\(7\\) VARYING" \
        "CHARS \\(7\\) VARYING" \
        "print varying string location"
        "print varying string location"
    test_print_accept "whatis strl1" "strm2" \
    test_print_accept "whatis strl1" "strm2" \
        "print string locationa mode name"
        "print string locationa mode name"
    test_print_accept "print strl1" \
    test_print_accept "print strl1" \
        {\"hansi\^\(0\)\"} \
        {\"hansi\^\(0\)\"} \
        "print string location"
        "print string location"
    # string elements
    # string elements
    test_print_accept "print strl1(0)" "\'h\'" \
    test_print_accept "print strl1(0)" "\'h\'" \
        "print string element 1"
        "print string element 1"
    test_print_accept "print strl1(5)" {'\^[(]0[)]'} \
    test_print_accept "print strl1(5)" {'\^[(]0[)]'} \
        "print string element 2"
        "print string element 2"
    test_print_accept "print strl1(3)" "\'s\'" \
    test_print_accept "print strl1(3)" "\'s\'" \
        "print string element 3"
        "print string element 3"
    test_print_accept "ptype strl1(0)" "char" \
    test_print_accept "ptype strl1(0)" "char" \
        "print mode of string element"
        "print mode of string element"
    # slices
    # slices
    test_print_accept "print strl1(3:4)" "\"si\"" \
    test_print_accept "print strl1(3:4)" "\"si\"" \
        "print string slice 1"
        "print string slice 1"
    test_print_accept "print strl1(0:5)" \
    test_print_accept "print strl1(0:5)" \
        {\"hansi\^\(0\)\"} \
        {\"hansi\^\(0\)\"} \
        "print string slice 2"
        "print string slice 2"
    test_print_accept "print strl1(0:0)" "\"h\"" \
    test_print_accept "print strl1(0:0)" "\"h\"" \
        "print string slice 3"
        "print string slice 3"
    test_print_accept "print strl1(0 up 6)" \
    test_print_accept "print strl1(0 up 6)" \
        {\"hansi\^\(0\)\"} \
        {\"hansi\^\(0\)\"} \
        "print string slice 4"
        "print string slice 4"
    # FIXME: adjust error message, when implented
    # FIXME: adjust error message, when implented
    gdb_test "print strl1(6 up 1)" \
    gdb_test "print strl1(6 up 1)" \
        ".*slice.*out of range.*" \
        ".*slice.*out of range.*" \
        "print invalid string slice length"
        "print invalid string slice length"
    gdb_test "print strl1(-1 up 5)" \
    gdb_test "print strl1(-1 up 5)" \
        ".*slice.*out of range.*" \
        ".*slice.*out of range.*" \
        "print invalid string slice length"
        "print invalid string slice length"
    gdb_test "print strl1(-1:5)" \
    gdb_test "print strl1(-1:5)" \
        ".*slice.*out of range.*" \
        ".*slice.*out of range.*" \
        "print invalid string slice"
        "print invalid string slice"
    gdb_test "print strl1(-1:7)" \
    gdb_test "print strl1(-1:7)" \
        ".*slice.*out of range.*" \
        ".*slice.*out of range.*" \
        "print invalid string slice"
        "print invalid string slice"
    gdb_test "print strl1(0 up -1)" \
    gdb_test "print strl1(0 up -1)" \
        ".*slice.*out of range.*" \
        ".*slice.*out of range.*" \
        "print invalid string slice length"
        "print invalid string slice length"
    gdb_test "print strl1(0 up 0)" {""}
    gdb_test "print strl1(0 up 0)" {""}
    # bitstring locations
    # bitstring locations
    test_print_accept "ptype bstr1" \
    test_print_accept "ptype bstr1" \
        "BOOLS \\(20\\)" \
        "BOOLS \\(20\\)" \
        "print mode of bitstring location"
        "print mode of bitstring location"
    test_print_accept "whatis bstrl1" "bstr1" \
    test_print_accept "whatis bstrl1" "bstr1" \
        "print mode name of bitstring location"
        "print mode name of bitstring location"
    test_print_accept "print bstrl1" \
    test_print_accept "print bstrl1" \
        "B'10101010101010101010'" \
        "B'10101010101010101010'" \
        "print bitstring location"
        "print bitstring location"
    test_print_accept "ptype bstrl1(0)" "bool|BOOL" \
    test_print_accept "ptype bstrl1(0)" "bool|BOOL" \
        "print mode of bitstring element"
        "print mode of bitstring element"
    test_print_accept "print bstrl1(0)" "TRUE" \
    test_print_accept "print bstrl1(0)" "TRUE" \
        "print bitstring element 1"
        "print bitstring element 1"
    test_print_accept "print bstrl1(19)" "FALSE" \
    test_print_accept "print bstrl1(19)" "FALSE" \
        "print bitstring element 2"
        "print bitstring element 2"
    test_print_accept "print bstrl1(10)" "TRUE" \
    test_print_accept "print bstrl1(10)" "TRUE" \
        "print bitstring element 3"
        "print bitstring element 3"
    test_print_accept "print bstrl1(0:19)" \
    test_print_accept "print bstrl1(0:19)" \
        "B'10101010101010101010'" \
        "B'10101010101010101010'" \
        "print bitstring location slice 1"
        "print bitstring location slice 1"
    test_print_accept "print bstrl1(0:0)" \
    test_print_accept "print bstrl1(0:0)" \
        "B'1'" \
        "B'1'" \
        "print bitstring location slice 2"
        "print bitstring location slice 2"
    test_print_accept "print bstrl1(3:9)" \
    test_print_accept "print bstrl1(3:9)" \
        "B'0101010'" \
        "B'0101010'" \
        "print bitstring location slice 3"
        "print bitstring location slice 3"
    test_print_accept "print bstrl1(0 up 20)" \
    test_print_accept "print bstrl1(0 up 20)" \
        "B'10101010101010101010'" \
        "B'10101010101010101010'" \
        "print bitstring location slice 4"
        "print bitstring location slice 4"
    test_print_accept "print bstrl1(19 up 1)" \
    test_print_accept "print bstrl1(19 up 1)" \
        "B'0'" \
        "B'0'" \
        "print bitstring location slice 5"
        "print bitstring location slice 5"
    gdb_test "print bstrl1(20 up 1)" \
    gdb_test "print bstrl1(20 up 1)" \
        ".*slice out of range.*" \
        ".*slice out of range.*" \
        "print invalid bitstring slice (20 up 1)"
        "print invalid bitstring slice (20 up 1)"
    gdb_test "print bstrl1(-4:5)" \
    gdb_test "print bstrl1(-4:5)" \
        ".*slice out of range.*" \
        ".*slice out of range.*" \
        "print invalid bitstring slice (-4:5)"
        "print invalid bitstring slice (-4:5)"
    gdb_test "print bstrl1(-1:up 1)" \
    gdb_test "print bstrl1(-1:up 1)" \
        ".*invalid expression syntax.*" \
        ".*invalid expression syntax.*" \
        "print invalid bitstring slice (-1:ip 1)"
        "print invalid bitstring slice (-1:ip 1)"
    gdb_test "print bstrl1(-1:20)" \
    gdb_test "print bstrl1(-1:20)" \
        ".*slice out of range.*" \
        ".*slice out of range.*" \
        "print invalid bitstring slice (-1:20)"
        "print invalid bitstring slice (-1:20)"
    gdb_test "print bstrl1(0 up -1)" \
    gdb_test "print bstrl1(0 up -1)" \
        ".*slice out of range.*" \
        ".*slice out of range.*" \
        "print invalid bitstring slice (0 up -1)"
        "print invalid bitstring slice (0 up -1)"
    test_print_accept "print bstrl1(4 up 0)" "B''"
    test_print_accept "print bstrl1(4 up 0)" "B''"
    # array mode locations
    # array mode locations
    gdb_test_exact "ptype arrl1" \
    gdb_test_exact "ptype arrl1" \
        "ARRAY (1:100) set1" \
        "ARRAY (1:100) set1" \
        "print mode of array location"
        "print mode of array location"
    gdb_test "whatis arrl1" "arr1m" \
    gdb_test "whatis arrl1" "arr1m" \
        "print mode name of array location"
        "print mode name of array location"
    gdb_test_exact "print arrl1" {[(1:100): aaa]} \
    gdb_test_exact "print arrl1" {[(1:100): aaa]} \
        "print array location"
        "print array location"
    test_print_accept "ptype arrl1(1)" \
    test_print_accept "ptype arrl1(1)" \
        "SET \\(aaa, bbb, ccc\\)" \
        "SET \\(aaa, bbb, ccc\\)" \
        "print mode of array element"
        "print mode of array element"
    gdb_test_exact "print arrl3" \
    gdb_test_exact "print arrl3" \
        {[(1:5): [(1:3): [(1:2): -2147483648]]]} \
        {[(1:5): [(1:3): [(1:2): -2147483648]]]} \
        "print array location 2"
        "print array location 2"
    gdb_test_exact "print arrl3(1)" \
    gdb_test_exact "print arrl3(1)" \
        {[(1:3): [(1:2): -2147483648]]} \
        {[(1:3): [(1:2): -2147483648]]} \
        "print array location 3"
        "print array location 3"
    gdb_test_exact "ptype arrl3(1)" \
    gdb_test_exact "ptype arrl3(1)" \
        {ARRAY (1:3) ARRAY (1:2) long} \
        {ARRAY (1:3) ARRAY (1:2) long} \
        "print mode of array element"
        "print mode of array element"
    test_print_accept "print arrl3(5)" \
    test_print_accept "print arrl3(5)" \
        {\[\(1:3\): \[\(1:2\): -2147483648\]\]} \
        {\[\(1:3\): \[\(1:2\): -2147483648\]\]} \
        "print array location 4"
        "print array location 4"
    test_print_accept "print arrl3(1,1)" \
    test_print_accept "print arrl3(1,1)" \
        {\[\(1:2\): -2147483648\]} \
        {\[\(1:2\): -2147483648\]} \
        "print array location 5"
        "print array location 5"
    test_print_accept "ptype arrl3(1,1)" \
    test_print_accept "ptype arrl3(1,1)" \
        {ARRAY \(1:2\) long} \
        {ARRAY \(1:2\) long} \
        "print mode of array element"
        "print mode of array element"
    test_print_accept "print arrl3(5,3)" \
    test_print_accept "print arrl3(5,3)" \
        {\[\(1:2\): -2147483648\]} \
        {\[\(1:2\): -2147483648\]} \
        "print array location 6"
        "print array location 6"
    test_print_accept "print arrl3(1,1,1)" \
    test_print_accept "print arrl3(1,1,1)" \
        "-2147483648" \
        "-2147483648" \
        "print array location 7"
        "print array location 7"
    test_print_accept "print arrl3(5,3,2)" \
    test_print_accept "print arrl3(5,3,2)" \
        "-2147483648" \
        "-2147483648" \
        "print array location 8"
        "print array location 8"
    test_print_accept "print arrl3(1)(3)(2)" \
    test_print_accept "print arrl3(1)(3)(2)" \
        "-2147483648" \
        "-2147483648" \
        "print array location 9"
        "print array location 9"
    # reject the following range fails
    # reject the following range fails
    # FIXME: adjust error messages
    # FIXME: adjust error messages
    gdb_test "print arrl3(-1)" \
    gdb_test "print arrl3(-1)" \
        ".*out of range.*" \
        ".*out of range.*" \
        "check invalid array indices 1"
        "check invalid array indices 1"
    gdb_test "print arrl3(6)" \
    gdb_test "print arrl3(6)" \
        ".*out of range.*" \
        ".*out of range.*" \
        "check invalid array indices 2"
        "check invalid array indices 2"
    gdb_test "print arrl3(0,0)" \
    gdb_test "print arrl3(0,0)" \
        ".*out of range.*" \
        ".*out of range.*" \
        "check invalid array indices 3"
        "check invalid array indices 3"
    gdb_test "print arrl3(1,0)" \
    gdb_test "print arrl3(1,0)" \
        ".*out of range.*" \
        ".*out of range.*" \
        "check invalid array indices 4"
        "check invalid array indices 4"
    gdb_test "print arrl3(1,4)" \
    gdb_test "print arrl3(1,4)" \
        ".*out of range.*" \
        ".*out of range.*" \
        "check invalid array indices 5"
        "check invalid array indices 5"
    gdb_test "print arrl3(6,4)" \
    gdb_test "print arrl3(6,4)" \
        ".*out of range.*" \
        ".*out of range.*" \
        "check invalid array indices 6"
        "check invalid array indices 6"
    gdb_test "print arrl3(1,1,0)" \
    gdb_test "print arrl3(1,1,0)" \
        ".*out of range.*" \
        ".*out of range.*" \
        "check invalid array indices 7"
        "check invalid array indices 7"
    gdb_test "print arrl3(6,4,0)" \
    gdb_test "print arrl3(6,4,0)" \
        ".*out of range.*" \
        ".*out of range.*" \
        "check invalid array indices 8"
        "check invalid array indices 8"
    gdb_test "print arrl3(1,1,3)" \
    gdb_test "print arrl3(1,1,3)" \
        ".*out of range.*" \
        ".*out of range.*" \
        "check invalid array indices 9"
        "check invalid array indices 9"
    gdb_test "print arrl3(0)(0)" \
    gdb_test "print arrl3(0)(0)" \
        ".* array or string index out of range.*" \
        ".* array or string index out of range.*" \
        "check invalid array indices 10"
        "check invalid array indices 10"
    gdb_test "print arrl3(1)(0)" \
    gdb_test "print arrl3(1)(0)" \
        ".* array or string index out of range.*" \
        ".* array or string index out of range.*" \
        "check invalid array indices 11"
        "check invalid array indices 11"
    gdb_test "print arrl3(1)(4)" \
    gdb_test "print arrl3(1)(4)" \
        ".* array or string index out of range.*" \
        ".* array or string index out of range.*" \
        "check invalid array indices 12"
        "check invalid array indices 12"
    gdb_test "print arrl3(6)(4)" \
    gdb_test "print arrl3(6)(4)" \
        ".* array or string index out of range.*" \
        ".* array or string index out of range.*" \
        "check invalid array indices 13"
        "check invalid array indices 13"
    gdb_test "print arrl3(1)(1)(0)" \
    gdb_test "print arrl3(1)(1)(0)" \
        ".* array or string index out of range.*" \
        ".* array or string index out of range.*" \
        "check invalid array indices 14"
        "check invalid array indices 14"
    gdb_test "print arrl3(6)(4)(0)" \
    gdb_test "print arrl3(6)(4)(0)" \
        ".* array or string index out of range.*" \
        ".* array or string index out of range.*" \
        "check invalid array indices 15"
        "check invalid array indices 15"
    gdb_test "print arrl3(1)(1)(3)" \
    gdb_test "print arrl3(1)(1)(3)" \
        ".* array or string index out of range.*" \
        ".* array or string index out of range.*" \
        "check invalid array indices 16"
        "check invalid array indices 16"
    # slices
    # slices
    test_print_accept "print arrl4(1:3)" \
    test_print_accept "print arrl4(1:3)" \
        {\[\(1:2\): \[\(1:3\): \[\(1:2\): -2147483648\]\], \(3\): \[\(1:3\): \[\(1:2\): 100\]\]\]} \
        {\[\(1:2\): \[\(1:3\): \[\(1:2\): -2147483648\]\], \(3\): \[\(1:3\): \[\(1:2\): 100\]\]\]} \
        "print array slice 1"
        "print array slice 1"
    test_print_accept "ptype arrl4(1:3)" \
    test_print_accept "ptype arrl4(1:3)" \
        {ARRAY \(1:3\) ARRAY \(1:3\) ARRAY \(1:2\) long} \
        {ARRAY \(1:3\) ARRAY \(1:3\) ARRAY \(1:2\) long} \
        "print mode of array slice"
        "print mode of array slice"
# The next one is bogus:
# The next one is bogus:
#    test_print_accept "print arrl4(5, 2:3, 1)" \
#    test_print_accept "print arrl4(5, 2:3, 1)" \
#       # FIXME: maybe the '(1): ' in the inner tupel should be omitted ? \
#       # FIXME: maybe the '(1): ' in the inner tupel should be omitted ? \
#       {\[(2): \[\(1\): 100\], \(3\):\[\(1\): 100\]\]} \
#       {\[(2): \[\(1\): 100\], \(3\):\[\(1\): 100\]\]} \
#       "print array slice 2"
#       "print array slice 2"
    test_print_accept "print arrl4(1 up 4)" \
    test_print_accept "print arrl4(1 up 4)" \
        {\[\(1:2\): \[\(1:3\): \[\(1:2\): -2147483648\]\], \(3\): \[\(1:3\): \[\(1:2\): 100\]\], \(4\): \[\(1:3\): \[\(1:2\): -2147483648\]\]\]} \
        {\[\(1:2\): \[\(1:3\): \[\(1:2\): -2147483648\]\], \(3\): \[\(1:3\): \[\(1:2\): 100\]\], \(4\): \[\(1:3\): \[\(1:2\): -2147483648\]\]\]} \
        "print array slice 3"
        "print array slice 3"
# The next two are bogus:
# The next two are bogus:
#    test_print_accept "print arrl4(3, 2 up 1)" \
#    test_print_accept "print arrl4(3, 2 up 1)" \
#       {\[\(2:3\): \[\(1:2\): 100\]\]} \
#       {\[\(2:3\): \[\(1:2\): 100\]\]} \
#       "print array slice 4"
#       "print array slice 4"
#    test_print_accept "print arrl4(1:2, 1 up 1, 2)" \
#    test_print_accept "print arrl4(1:2, 1 up 1, 2)" \
#       {\[\(1\): \[\(1\): \[\(2\): -2147483648\], \(2\): \[\(2\): -2147483648\]\], \(2\): \[\(1\): \[\(2\): -2147483648\], \(2\): \[\(2\): -2147483648\]\]\]} \
#       {\[\(1\): \[\(1\): \[\(2\): -2147483648\], \(2\): \[\(2\): -2147483648\]\], \(2\): \[\(1\): \[\(2\): -2147483648\], \(2\): \[\(2\): -2147483648\]\]\]} \
#       "print array slice 4"
#       "print array slice 4"
    # reject invalid slices
    # reject invalid slices
    # FIXME: adjust error messages
    # FIXME: adjust error messages
    gdb_test "print arrl4(5:6)" \
    gdb_test "print arrl4(5:6)" \
        ".*slice out of range.*" \
        ".*slice out of range.*" \
        "check invalid range 1"
        "check invalid range 1"
    gdb_test "print arrl4(0:1)" \
    gdb_test "print arrl4(0:1)" \
        ".*slice out of range.*" \
        ".*slice out of range.*" \
        "check invalid range 2"
        "check invalid range 2"
    gdb_test "print arrl4(0:6)" \
    gdb_test "print arrl4(0:6)" \
        ".*slice out of range.*" \
        ".*slice out of range.*" \
        "check invalid range 3"
        "check invalid range 3"
    gdb_test "print arrl4(3:2)" \
    gdb_test "print arrl4(3:2)" \
        ".*slice out of range.*" \
        ".*slice out of range.*" \
        "check invalid range 4"
        "check invalid range 4"
    gdb_test "print arrl4(1,3:4)" \
    gdb_test "print arrl4(1,3:4)" \
        ".*syntax error.*" \
        ".*syntax error.*" \
        "check invalid range 5"
        "check invalid range 5"
    gdb_test "print arrl4(1,0:1)" \
    gdb_test "print arrl4(1,0:1)" \
        ".*syntax error.*" \
        ".*syntax error.*" \
        "check invalid range 6"
        "check invalid range 6"
    gdb_test "print arrl4(1,0:4)" \
    gdb_test "print arrl4(1,0:4)" \
        ".*syntax error.*" \
        ".*syntax error.*" \
        "check invalid range 7"
        "check invalid range 7"
    gdb_test "print arrl4(1,3:2)" \
    gdb_test "print arrl4(1,3:2)" \
        ".*syntax error.*" \
        ".*syntax error.*" \
        "check invalid range 8"
        "check invalid range 8"
    gdb_test "print arrl4(5 up 2)" \
    gdb_test "print arrl4(5 up 2)" \
        ".*slice out of range.*" \
        ".*slice out of range.*" \
        "check invalid range 9"
        "check invalid range 9"
    gdb_test "print arrl4(-1 up 1)" \
    gdb_test "print arrl4(-1 up 1)" \
        ".*slice out of range.*" \
        ".*slice out of range.*" \
        "check invalid range 10"
        "check invalid range 10"
    gdb_test "print arrl4(-1 up 7)" \
    gdb_test "print arrl4(-1 up 7)" \
        ".*slice out of range.*" \
        ".*slice out of range.*" \
        "check invalid range 11"
        "check invalid range 11"
    gdb_test "print arrl4(1 up 0)" \
    gdb_test "print arrl4(1 up 0)" \
        ".*slice out of range.*" \
        ".*slice out of range.*" \
        "check invalid range 12"
        "check invalid range 12"
    gdb_test "print arrl4(1,3 up 1)" \
    gdb_test "print arrl4(1,3 up 1)" \
        ".*syntax error.*" \
        ".*syntax error.*" \
        "check invalid range 13"
        "check invalid range 13"
    gdb_test "print arrl4(1,-1 up 1)" \
    gdb_test "print arrl4(1,-1 up 1)" \
        ".*syntax error.*" \
        ".*syntax error.*" \
        "check invalid range 14"
        "check invalid range 14"
    gdb_test "print arrl4(1,-1 up 5)" \
    gdb_test "print arrl4(1,-1 up 5)" \
        ".*syntax error.*" \
        ".*syntax error.*" \
        "check invalid range 15"
        "check invalid range 15"
    gdb_test "print arrl4(1,2 up 0)" \
    gdb_test "print arrl4(1,2 up 0)" \
        ".*syntax error.*" \
        ".*syntax error.*" \
        "check invalid range 16"
        "check invalid range 16"
    # structure modes
    # structure modes
    # some tests are in chillvars.exp
    # some tests are in chillvars.exp
    # FIXME: no tag processing implemented do maybe adjust these tests
    # FIXME: no tag processing implemented do maybe adjust these tests
    setup_xfail "*-*-*"
    setup_xfail "*-*-*"
    test_print_accept "ptype stru1m" \
    test_print_accept "ptype stru1m" \
        "STRUCT \\(.*a long,.*b long,.*CASE b OF.*\\(42\\):.*ch1 CHARS\\(20\\),.*\\(52\\):.*ch2 CHARS\\(10\\).*ELSE.*ch3 CHARS\\(1\\).*ESAC.*\\)" \
        "STRUCT \\(.*a long,.*b long,.*CASE b OF.*\\(42\\):.*ch1 CHARS\\(20\\),.*\\(52\\):.*ch2 CHARS\\(10\\).*ELSE.*ch3 CHARS\\(1\\).*ESAC.*\\)" \
        "print mode of structure location 1"
        "print mode of structure location 1"
    test_print_accept "whatis strul1" "stru1m" \
    test_print_accept "whatis strul1" "stru1m" \
        "print mode name of structure location 1"
        "print mode name of structure location 1"
    setup_xfail "*-*-*"
    setup_xfail "*-*-*"
    test_print_accept "print strul1" \
    test_print_accept "print strul1" \
        {\[\.a: -2147483648, \.b: 42, \.\(b\): \{\(42\) = \[\.ch1: \"12345678900987654321\"\], \(52\) = \[\.ch2: \"1234567890\"\], (else) = \[\.ch3: \"1\"\]\}\]} \
        {\[\.a: -2147483648, \.b: 42, \.\(b\): \{\(42\) = \[\.ch1: \"12345678900987654321\"\], \(52\) = \[\.ch2: \"1234567890\"\], (else) = \[\.ch3: \"1\"\]\}\]} \
        "print structure location 1"
        "print structure location 1"
    test_print_accept "print strul1.a" \
    test_print_accept "print strul1.a" \
        "-2147483648" \
        "-2147483648" \
        "print field of structure location 1"
        "print field of structure location 1"
    test_print_accept "print strul1.b" "42" \
    test_print_accept "print strul1.b" "42" \
        "print field of structure location 1"
        "print field of structure location 1"
    test_print_accept "print strul1.ch1" \
    test_print_accept "print strul1.ch1" \
        "\"12345678900987654321\"" \
        "\"12345678900987654321\"" \
        "print field of structure location 1"
        "print field of structure location 1"
    # setup_xfail "*-*-*"
    # setup_xfail "*-*-*"
    test_print_accept "print strul1.ch2" \
    test_print_accept "print strul1.ch2" \
        "\"1234567890\"" \
        "\"1234567890\"" \
        "print field of structure location 1"
        "print field of structure location 1"
    # setup_xfail "*-*-*"
    # setup_xfail "*-*-*"
    test_print_accept "print strul1.ch3" \
    test_print_accept "print strul1.ch3" \
        "\"1\"" \
        "\"1\"" \
        "print field of structure location 1"
        "print field of structure location 1"
    if $passcount then {
    if $passcount then {
        pass "$passcount correct locations printed"
        pass "$passcount correct locations printed"
    }
    }
}
}
# This is chill/9434
# This is chill/9434
proc test_9434 {} {
proc test_9434 {} {
    global passcount
    global passcount
    verbose "testing pr-9434"
    verbose "testing pr-9434"
    test_print_accept "ptype m_xyzmode" "STRUCT \\(.*next REF m_xyzmode,.*i long.*\\)"
    test_print_accept "ptype m_xyzmode" "STRUCT \\(.*next REF m_xyzmode,.*i long.*\\)"
}
}
# Start with a fresh gdb.
# Start with a fresh gdb.
gdb_exit
gdb_exit
gdb_start
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_reinitialize_dir $srcdir/$subdir
gdb_test "set print sevenbit-strings" ".*"
gdb_test "set print sevenbit-strings" ".*"
if [set_lang_chill] then {
if [set_lang_chill] then {
    test_modes
    test_modes
    test_locations
    test_locations
    test_9434
    test_9434
} else {
} else {
    warning "$test_name tests suppressed."
    warning "$test_name tests suppressed."
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.