* gch1272.{ch,exp}, gch1280.{ch,exp}, pr-9946.{ch,exp}:

New test cases.
This commit is contained in:
Wilfried Moser 1996-09-04 14:34:15 +00:00
parent b5865bb263
commit 9811b59602
8 changed files with 293 additions and 0 deletions

View File

@ -46,6 +46,10 @@ gch981.ch
gch981.exp
gch1041.ch
gch1041.exp
gch1272.ch
gch1272.exp
gch1280.ch
gch1280.exp
misc.ch
misc.exp
powerset.ch
@ -81,6 +85,8 @@ pr-8894-grt.ch
pr-8894.exp
pr-9095.ch
pr-9095.exp
pr-9946.ch
pr-9946.exp
result.ch
result.exp
string.ch

View File

@ -1,3 +1,8 @@
Wed Sep 4 07:30:44 1996 Wilfried Moser (Alcatel) <moser@rtl.cygnus.com>
* gch1272.{ch,exp}, gch1280.{ch,exp}, pr-9946.{ch,exp}:
New test cases.
Sun Aug 18 13:29:48 1996 Fred Fish <fnf@cygnus.com>
* tests2.exp: Remove mips-sgi-irix* setup_xfail for

View File

@ -0,0 +1,21 @@
gch1272: MODULE
SYNMODE m_array = ARRAY (0:99) INT;
DCL foo m_array;
SYNMODE m_xxx = ARRAY (1:10) LONG;
SYNMODE m_struct = STRUCT (i LONG, b BOOL);
SYNMODE m_bar = ARRAY (-10:20) m_struct;
DCL bar m_bar;
SYNMODE m_ps = POWERSET LONG (0:20);
brrr: PROC ()
END;
foo := [ (*): 222 ];
brrr ();
END gch1272;

View File

@ -0,0 +1,86 @@
# Copyright (C) 1995 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
# This file was written by Wilfried Moser (moser@aut.alcatel.at)
#
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "gch1272"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
# Set the current language to chill. This counts as a test. If it
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
gdb_load $binfile
send "set language chill\n"
expect {
-re ".*$prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
return [gdb_test "show language" ".* source language is \"chill\".*" \
"set language to \"chill\""]
}
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
send "set print sevenbit-strings\n" ; expect -re ".*$prompt $"
if ![set_lang_chill] then {
runto brrr
# check foo
gdb_test {print foo} { = \[\(0:99\): 222\]}
send "set var foo := m_array\[\(\*\):44\]\n" ; expect -re ".*$prompt $"
gdb_test {print foo} { = \[\(0:99\): 44\]}
# check bar
gdb_test {print bar} { = \[\(-10:20\): \[.i: 0, .b: FALSE\]\]}
send "set var bar := m_bar\[\(\*\): \[42, TRUE\]\]\n" ; expect -re ".*$prompt $"
gdb_test {print bar} { = \[\(-10:20\): \[.i: 42, .b: TRUE\]\]}
# some failues
gdb_test "set var foo := \[\(\*\):44\]" {\(\*\) only possible with modename in front of tuple \(mode\[\.\.\]\)}
gdb_test "set var foo := m_xxx\[\(\*\):44\]" {Invalid cast\.}
gdb_test "set var foo := m_struct\[\(\*\):44\]" {\(\*\) in invalid context}
gdb_test "set var foo := m_ps\[\(\*\):44\]" {\(\*\) in invalid context}
}

View File

@ -0,0 +1,13 @@
gch1280: MODULE
SYNMODE m_x = ARRAY (1:3) LONG;
DCL v_x m_x;
DCL v_xx m_x;
doit: PROC ()
END doit;
v_x := [ 11, 12, 13 ];
doit ();
END gch1280;

View File

@ -0,0 +1,73 @@
# Copyright (C) 1995 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
# This file was written by Wilfried Moser (moser@aut.alcatel.at)
#
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "gch1280"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
# Set the current language to chill. This counts as a test. If it
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
gdb_load $binfile
send "set language chill\n"
expect {
-re ".*$prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
return [gdb_test "show language" ".* source language is \"chill\".*" \
"set language to \"chill\""]
}
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
send "set print sevenbit-strings\n" ; expect -re ".*$prompt $"
if ![set_lang_chill] then {
runto doit
send "next\n" ; expect -re "$prompt $"
# check too many array elements
gdb_test {set var v_x := [1,2,3,4,5]} {Too many array elements}
}

View File

@ -0,0 +1,10 @@
x: module
synmode aset = SET (stopped, moving);
DCL xyz aset;
xyz := moving;
xyz := SUCC (xyz);
END x;

View File

@ -0,0 +1,79 @@
# Copyright (C) 1995 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
# This file was written by Fred Fish. (fnf@cygnus.com)
# Martin Pottendorfer (pottendo@aut.alcatel.at)
#
if $tracelevel then {
strace $tracelevel
}
if [skip_chill_tests] then { continue }
set testfile "pr-9946"
set srcfile ${srcdir}/$subdir/${testfile}.ch
set binfile ${objdir}/${subdir}/${testfile}.exe
if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
# Set the current language to chill. This counts as a test. If it
# fails, then we skip the other tests.
proc set_lang_chill {} {
global prompt
global binfile objdir subdir
verbose "loading file '$binfile'"
gdb_load $binfile
send "set language chill\n"
expect {
-re ".*$prompt $" {}
timeout { fail "set language chill (timeout)" ; return 0 }
}
return [gdb_test "show language" ".* source language is \"chill\".*" \
"set language to \"chill\""]
}
set prms_id 0
set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
send "set print sevenbit-strings\n" ; expect -re ".*$prompt $"
if ![set_lang_chill] then {
runto x_
send "next\n" ; expect -re "$prompt $"
# check comparison of SET's
gdb_test {print xyz=moving} { = TRUE}
gdb_test {print xyz/=moving} { = FALSE}
gdb_test {print xyz<moving} { = FALSE}
gdb_test {print xyz<=moving} { = TRUE}
gdb_test {print xyz>moving} { = FALSE}
gdb_test {print xyz>=moving} { = TRUE}
}