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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [testsuite/] [gdb.c++/] [ctti.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) 1998, 1999 Free Software Foundation, Inc.
# Copyright (C) 1998, 1999 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 is part of the gdb testsuite
# This file is part of the gdb testsuite
# file written by Elena Zannoni (ezannoni@cygnus.com)
# file written by Elena Zannoni (ezannoni@cygnus.com)
#
#
# source files cttiadd.cc, cttiadd1.cc, cttiadd2.cc, cttiadd3.cc
# source files cttiadd.cc, cttiadd1.cc, cttiadd2.cc, cttiadd3.cc
#
#
if $tracelevel then {
if $tracelevel then {
        strace $tracelevel
        strace $tracelevel
}
}
if { [skip_cplus_tests] } { continue }
if { [skip_cplus_tests] } { continue }
set testfile "cttiadd"
set testfile "cttiadd"
set srcfile  ${testfile}.cc
set srcfile  ${testfile}.cc
set srcfile1 ${testfile}1.cc
set srcfile1 ${testfile}1.cc
set srcfile2 ${testfile}2.cc
set srcfile2 ${testfile}2.cc
set srcfile3 ${testfile}3.cc
set srcfile3 ${testfile}3.cc
set binfile ${objdir}/${subdir}/${testfile}
set binfile ${objdir}/${subdir}/${testfile}
if [get_compiler_info ${binfile} "c++"] {
if [get_compiler_info ${binfile} "c++"] {
    return -1;
    return -1;
}
}
if { $gcc_compiled } then { continue }
if { $gcc_compiled } then { continue }
#if  { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}" "${binfile}" executable {debug c++}] != "" } {
#if  { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}" "${binfile}" executable {debug c++}] != "" } {
#     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
#     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
#}
#}
set cmdline "$CXX_FOR_TARGET ${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3} -g -o ${binfile}"
set cmdline "$CXX_FOR_TARGET ${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3} -g -o ${binfile}"
remote_exec build $cmdline
remote_exec build $cmdline
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
}
}
send_gdb "n\n"
send_gdb "n\n"
gdb_expect {
gdb_expect {
    -re "$decimal.*i = 2;.*$gdb_prompt $" {
    -re "$decimal.*i = 2;.*$gdb_prompt $" {
        pass "next "
        pass "next "
      }
      }
    -re ".*$gdb_prompt $" { fail "next " }
    -re ".*$gdb_prompt $" { fail "next " }
    timeout           { fail "next " }
    timeout           { fail "next " }
  }
  }
send_gdb "n\n"
send_gdb "n\n"
gdb_expect {
gdb_expect {
    -re "$decimal.*f = 4.5;.*$gdb_prompt $" {
    -re "$decimal.*f = 4.5;.*$gdb_prompt $" {
        pass "next "
        pass "next "
      }
      }
    -re ".*$gdb_prompt $" { fail "next " }
    -re ".*$gdb_prompt $" { fail "next " }
    timeout           { fail "next " }
    timeout           { fail "next " }
  }
  }
send_gdb "n\n"
send_gdb "n\n"
gdb_expect {
gdb_expect {
    -re "$decimal.*c = add\\(c, c\\);.*$gdb_prompt $" {
    -re "$decimal.*c = add\\(c, c\\);.*$gdb_prompt $" {
        pass "next "
        pass "next "
      }
      }
    -re ".*$gdb_prompt $" { fail "next " }
    -re ".*$gdb_prompt $" { fail "next " }
    timeout           { fail "next " }
    timeout           { fail "next " }
  }
  }
send_gdb "n\n"
send_gdb "n\n"
gdb_expect {
gdb_expect {
    -re "$decimal.*i = add\\(i, i\\);.*$gdb_prompt $" {
    -re "$decimal.*i = add\\(i, i\\);.*$gdb_prompt $" {
        pass "next "
        pass "next "
      }
      }
    -re ".*$gdb_prompt $" { fail "next " }
    -re ".*$gdb_prompt $" { fail "next " }
    timeout           { fail "next " }
    timeout           { fail "next " }
  }
  }
send_gdb "n\n"
send_gdb "n\n"
gdb_expect {
gdb_expect {
    -re "$decimal.*f = add\\(f, f\\);.*$gdb_prompt $" {
    -re "$decimal.*f = add\\(f, f\\);.*$gdb_prompt $" {
        pass "next "
        pass "next "
      }
      }
    -re ".*$gdb_prompt $" { fail "next " }
    -re ".*$gdb_prompt $" { fail "next " }
    timeout           { fail "next " }
    timeout           { fail "next " }
  }
  }
send_gdb "n\n"
send_gdb "n\n"
gdb_expect {
gdb_expect {
    -re "$decimal.*add1\\(\\);.*$gdb_prompt $" {
    -re "$decimal.*add1\\(\\);.*$gdb_prompt $" {
        pass "next "
        pass "next "
      }
      }
    -re ".*$gdb_prompt $" { fail "next " }
    -re ".*$gdb_prompt $" { fail "next " }
    timeout           { fail "next " }
    timeout           { fail "next " }
  }
  }
send_gdb "print c\n"
send_gdb "print c\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = -62.*\r\n$gdb_prompt $" {
    -re ".$decimal = -62.*\r\n$gdb_prompt $" {
        pass "print value of c"
        pass "print value of c"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of c" }
    -re ".*$gdb_prompt $" { fail "print value of c" }
    timeout           { fail "(timeout) print value of c" }
    timeout           { fail "(timeout) print value of c" }
  }
  }
send_gdb "print f\n"
send_gdb "print f\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = 9\r\n$gdb_prompt $" {
    -re ".$decimal = 9\r\n$gdb_prompt $" {
        pass "print value of f"
        pass "print value of f"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of f" }
    -re ".*$gdb_prompt $" { fail "print value of f" }
    timeout           { fail "(timeout) print value of f" }
    timeout           { fail "(timeout) print value of f" }
  }
  }
send_gdb "print i\n"
send_gdb "print i\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = 4\r\n$gdb_prompt $" {
    -re ".$decimal = 4\r\n$gdb_prompt $" {
        pass "print value of i"
        pass "print value of i"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of i" }
    -re ".*$gdb_prompt $" { fail "print value of i" }
    timeout           { fail "(timeout) print value of i" }
    timeout           { fail "(timeout) print value of i" }
  }
  }
send_gdb "print add(2,2)\n"
send_gdb "print add(2,2)\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = 4\r\n$gdb_prompt $" {
    -re ".$decimal = 4\r\n$gdb_prompt $" {
        pass "print value of add(2,2)"
        pass "print value of add(2,2)"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of add(2,2)" }
    -re ".*$gdb_prompt $" { fail "print value of add(2,2)" }
    timeout           { fail "(timeout) print value of add(2,2)" }
    timeout           { fail "(timeout) print value of add(2,2)" }
  }
  }
send_gdb "print add(2.3,2.3)\n"
send_gdb "print add(2.3,2.3)\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = 4\\.5\[0-9\]+\r\n$gdb_prompt $" {
    -re ".$decimal = 4\\.5\[0-9\]+\r\n$gdb_prompt $" {
        pass "print value of add(2.3,2.3)"
        pass "print value of add(2.3,2.3)"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of add(2.3,2.3)" }
    -re ".*$gdb_prompt $" { fail "print value of add(2.3,2.3)" }
    timeout           { fail "(timeout) print value of add(2.3,2.3)" }
    timeout           { fail "(timeout) print value of add(2.3,2.3)" }
  }
  }
send_gdb "print add('A','A')\n"
send_gdb "print add('A','A')\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = -126.*202.\r\n$gdb_prompt $" {
    -re ".$decimal = -126.*202.\r\n$gdb_prompt $" {
        pass "print value of add('A','A')"
        pass "print value of add('A','A')"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of add('A','A')" }
    -re ".*$gdb_prompt $" { fail "print value of add('A','A')" }
    timeout           { fail "(timeout) print value of add('A','A')" }
    timeout           { fail "(timeout) print value of add('A','A')" }
  }
  }
send_gdb "print add2(2,2)\n"
send_gdb "print add2(2,2)\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = 4\r\n$gdb_prompt $" {
    -re ".$decimal = 4\r\n$gdb_prompt $" {
        pass "print value of add2(2,2)"
        pass "print value of add2(2,2)"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of add2(2,2)" }
    -re ".*$gdb_prompt $" { fail "print value of add2(2,2)" }
    timeout           { fail "(timeout) print value of add2(2,2)" }
    timeout           { fail "(timeout) print value of add2(2,2)" }
  }
  }
send_gdb "print add2(2.3,2.3)\n"
send_gdb "print add2(2.3,2.3)\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = 4\\.5\[0-9\]+\r\n$gdb_prompt $" {
    -re ".$decimal = 4\\.5\[0-9\]+\r\n$gdb_prompt $" {
        pass "print value of add2(2.3,2.3)"
        pass "print value of add2(2.3,2.3)"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of add2(2.3,2.3)" }
    -re ".*$gdb_prompt $" { fail "print value of add2(2.3,2.3)" }
    timeout           { fail "(timeout) print value of add2(2.3,2.3)" }
    timeout           { fail "(timeout) print value of add2(2.3,2.3)" }
  }
  }
send_gdb "print add2('A','A')\n"
send_gdb "print add2('A','A')\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = -126.*202.\r\n$gdb_prompt $" {
    -re ".$decimal = -126.*202.\r\n$gdb_prompt $" {
        pass "print value of add2('A','A')"
        pass "print value of add2('A','A')"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of add2('A','A')" }
    -re ".*$gdb_prompt $" { fail "print value of add2('A','A')" }
    timeout           { fail "(timeout) print value of add2('A','A')" }
    timeout           { fail "(timeout) print value of add2('A','A')" }
  }
  }
send_gdb "print add3(2,2)\n"
send_gdb "print add3(2,2)\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = 4\r\n$gdb_prompt $" {
    -re ".$decimal = 4\r\n$gdb_prompt $" {
        pass "print value of add3(2,2)"
        pass "print value of add3(2,2)"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of add3(2,2)" }
    -re ".*$gdb_prompt $" { fail "print value of add3(2,2)" }
    timeout           { fail "(timeout) print value of add3(2,2)" }
    timeout           { fail "(timeout) print value of add3(2,2)" }
  }
  }
send_gdb "print add3(2.3,2.3)\n"
send_gdb "print add3(2.3,2.3)\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = 4\\.5\[0-9\]+\r\n$gdb_prompt $" {
    -re ".$decimal = 4\\.5\[0-9\]+\r\n$gdb_prompt $" {
        pass "print value of add3(2.3,2.3)"
        pass "print value of add3(2.3,2.3)"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of add3(2.3,2.3)" }
    -re ".*$gdb_prompt $" { fail "print value of add3(2.3,2.3)" }
    timeout           { fail "(timeout) print value of add3(2.3,2.3)" }
    timeout           { fail "(timeout) print value of add3(2.3,2.3)" }
  }
  }
send_gdb "print add3('A','A')\n"
send_gdb "print add3('A','A')\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = -126.*202.\r\n$gdb_prompt $" {
    -re ".$decimal = -126.*202.\r\n$gdb_prompt $" {
        pass "print value of add3('A','A')"
        pass "print value of add3('A','A')"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of add3('A','A')" }
    -re ".*$gdb_prompt $" { fail "print value of add3('A','A')" }
    timeout           { fail "(timeout) print value of add3('A','A')" }
    timeout           { fail "(timeout) print value of add3('A','A')" }
  }
  }
send_gdb "print add4(2,2)\n"
send_gdb "print add4(2,2)\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = 4\r\n$gdb_prompt $" {
    -re ".$decimal = 4\r\n$gdb_prompt $" {
        pass "print value of add4(2,2)"
        pass "print value of add4(2,2)"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of add4(2,2)" }
    -re ".*$gdb_prompt $" { fail "print value of add4(2,2)" }
    timeout           { fail "(timeout) print value of add4(2,2)" }
    timeout           { fail "(timeout) print value of add4(2,2)" }
  }
  }
send_gdb "print add4(2.3,2.3)\n"
send_gdb "print add4(2.3,2.3)\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = 4\\.5\[0-9\]+\r\n$gdb_prompt $" {
    -re ".$decimal = 4\\.5\[0-9\]+\r\n$gdb_prompt $" {
        pass "print value of add4(2.3,2.3)"
        pass "print value of add4(2.3,2.3)"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of add4(2.3,2.3)" }
    -re ".*$gdb_prompt $" { fail "print value of add4(2.3,2.3)" }
    timeout           { fail "(timeout) print value of add4(2.3,2.3)" }
    timeout           { fail "(timeout) print value of add4(2.3,2.3)" }
  }
  }
send_gdb "print add4('A','A')\n"
send_gdb "print add4('A','A')\n"
gdb_expect {
gdb_expect {
    -re ".$decimal = -126.*202.\r\n$gdb_prompt $" {
    -re ".$decimal = -126.*202.\r\n$gdb_prompt $" {
        pass "print value of add4('A','A')"
        pass "print value of add4('A','A')"
      }
      }
    -re ".*$gdb_prompt $" { fail "print value of add4('A','A')" }
    -re ".*$gdb_prompt $" { fail "print value of add4('A','A')" }
    timeout           { fail "(timeout) print value of add4('A','A')" }
    timeout           { fail "(timeout) print value of add4('A','A')" }
  }
  }
gdb_exit
gdb_exit
return 0
return 0
 
 

powered by: WebSVN 2.1.0

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