OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gdb-6.8/] [pre-binutils-2.20.1-sync/] [gdb/] [testsuite/] [gdb.cp/] [bs15503.exp] - Diff between revs 157 and 223

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

Rev 157 Rev 223
# Copyright 1992, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Copyright 1992, 2004, 2005, 2007, 2008 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 3 of the License, or
# the Free Software Foundation; either version 3 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, see .  */
# along with this program.  If not, see .  */
# Test case for CLLbs15503
# Test case for CLLbs15503
# This file was written by Sue Kimura (sue_kimura@hp.com)
# This file was written by Sue Kimura (sue_kimura@hp.com)
# Rewritten by Michael Chastain (mec.gnu@mindspring.com)
# Rewritten by Michael Chastain (mec.gnu@mindspring.com)
if $tracelevel {
if $tracelevel {
    strace $tracelevel
    strace $tracelevel
}
}
if { [skip_cplus_tests] } { continue }
if { [skip_cplus_tests] } { continue }
# On SPU this test fails because the executable exceeds local storage size.
# On SPU this test fails because the executable exceeds local storage size.
if { [istarget "spu*-*-*"] } {
if { [istarget "spu*-*-*"] } {
        return 0
        return 0
}
}
set testfile "bs15503"
set testfile "bs15503"
set srcfile ${testfile}.cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
set binfile ${objdir}/${subdir}/${testfile}
if [get_compiler_info ${binfile}] {
if [get_compiler_info ${binfile}] {
    return -1
    return -1
}
}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug c++"] != "" } {
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug c++"] != "" } {
    perror "Couldn't compile ${srcfile}"
    perror "Couldn't compile ${srcfile}"
    return -1
    return -1
}
}
gdb_exit
gdb_exit
gdb_start
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
gdb_load ${binfile}
if ![runto_main] then {
if ![runto_main] then {
    perror "couldn't run to breakpoint"
    perror "couldn't run to breakpoint"
    continue
    continue
}
}
# Set breakpoint on template function
# Set breakpoint on template function
gdb_test "break StringTest::testFunction" \
gdb_test "break StringTest::testFunction" \
    "Breakpoint $decimal at $hex: file .*${srcfile}, line $decimal."
    "Breakpoint $decimal at $hex: file .*${srcfile}, line $decimal."
gdb_test "continue" \
gdb_test "continue" \
    ".*Breakpoint $decimal, StringTest::testFunction \\(this=$hex\\).*" \
    ".*Breakpoint $decimal, StringTest::testFunction \\(this=$hex\\).*" \
    "continue to StringTest"
    "continue to StringTest"
# Run to some random point in the middle of the function.
# Run to some random point in the middle of the function.
gdb_breakpoint [gdb_get_line_number "find position where blank needs to be inserted"]
gdb_breakpoint [gdb_get_line_number "find position where blank needs to be inserted"]
gdb_continue_to_breakpoint "find position where blank needs to be inserted"
gdb_continue_to_breakpoint "find position where blank needs to be inserted"
# Call some string methods.
# Call some string methods.
gdb_test "print s.length()"             "\\$\[0-9\]+ = 42"
gdb_test "print s.length()"             "\\$\[0-9\]+ = 42"
gdb_test "print s\[0\]"                 "\\$\[0-9\]+ =.* 'I'"
gdb_test "print s\[0\]"                 "\\$\[0-9\]+ =.* 'I'"
gdb_test "print s\[s.length()-1\]"      "\\$\[0-9\]+ =.* 'g'"
gdb_test "print s\[s.length()-1\]"      "\\$\[0-9\]+ =.* 'g'"
gdb_test "print (const char *) s" \
gdb_test "print (const char *) s" \
    "\\$\[0-9\]+ = $hex \"I am a short stringand now a longer string\""
    "\\$\[0-9\]+ = $hex \"I am a short stringand now a longer string\""
# TODO: tests that do not work with gcc 2.95.3
# TODO: tests that do not work with gcc 2.95.3
# -- chastain 2004-01-07
# -- chastain 2004-01-07
#
#
# gdb_test "print s.compare(s)"         "\\$\[0-9\]+ = 0"
# gdb_test "print s.compare(s)"         "\\$\[0-9\]+ = 0"
# gdb_test "print s.compare(\"AAA\")"     "\\$\[0-9\]+ = 1"
# gdb_test "print s.compare(\"AAA\")"     "\\$\[0-9\]+ = 1"
# gdb_test "print s.compare(\"ZZZ\")"     "\\$\[0-9\]+ = -1"
# gdb_test "print s.compare(\"ZZZ\")"     "\\$\[0-9\]+ = -1"
# TODO: tests that do not work with gcc 2.95.3 and gcc 3.3.2.
# TODO: tests that do not work with gcc 2.95.3 and gcc 3.3.2.
# cannot call overloaded non-member operator.  -- chastain 2004-01-07
# cannot call overloaded non-member operator.  -- chastain 2004-01-07
#
#
# gdb_test "print s == s"                       "\\$\[0-9\]+ = true"
# gdb_test "print s == s"                       "\\$\[0-9\]+ = true"
# gdb_test "print s > "AAA"                     "\\$\[0-9\]+ = true"
# gdb_test "print s > "AAA"                     "\\$\[0-9\]+ = true"
# gdb_test "print s < "ZZZ"                     "\\$\[0-9\]+ = true"
# gdb_test "print s < "ZZZ"                     "\\$\[0-9\]+ = true"
# TODO: GDB doesn't know to convert the string to a const char *, and
# TODO: GDB doesn't know to convert the string to a const char *, and
# instead tries to use the string as a structure initializer.
# instead tries to use the string as a structure initializer.
#
#
# gdb_test "print s == \"I am a short stringand now a longer string\"" \
# gdb_test "print s == \"I am a short stringand now a longer string\"" \
#     "\\$\[0-9\]+ = true"
#     "\\$\[0-9\]+ = true"
gdb_test "print (const char *) s.substr(0,4)"   "\\$\[0-9\]+ = $hex \"I am\""
gdb_test "print (const char *) s.substr(0,4)"   "\\$\[0-9\]+ = $hex \"I am\""
gdb_test "print (const char *) (s=s.substr(0,4))" \
gdb_test "print (const char *) (s=s.substr(0,4))" \
    "\\$\[0-9\]+ = $hex \"I am\""
    "\\$\[0-9\]+ = $hex \"I am\""
# TODO: cannot call overloaded non-member operator again.
# TODO: cannot call overloaded non-member operator again.
# -- chastain 2004-01-07
# -- chastain 2004-01-07
#
#
# gdb_test "print (const char *) (s + s)" \
# gdb_test "print (const char *) (s + s)" \
#    "\\$\[0-9\]+ = $hex \"I amI am\""
#    "\\$\[0-9\]+ = $hex \"I amI am\""
# gdb_test "print (const char *) (s + \" \" + s)" \
# gdb_test "print (const char *) (s + \" \" + s)" \
#    "\\$\[0-9\]+ = $hex \"I am I am\""
#    "\\$\[0-9\]+ = $hex \"I am I am\""
 
 

powered by: WebSVN 2.1.0

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