⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 builtins.exp

📁 lwip在ucos上的移植
💻 EXP
📖 第 1 页 / 共 2 页
字号:
# Copyright (C) 1995, 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}.chset binfile ${objdir}/${subdir}/${testfile}.exeif  { [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 printedproc 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"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -