diff options
author | Per Bothner <per@bothner.com> | 1994-06-14 23:23:14 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1994-06-14 23:23:14 +0000 |
commit | ccda44f92fd49b95bd437a1c153b000647cc37ae (patch) | |
tree | 9bb112f2899f20b58f78f49ae1bd200ef144abf1 /gdb | |
parent | f2d9c058026d32e92d1593a084bcf2e34e915f92 (diff) | |
download | gdb-ccda44f92fd49b95bd437a1c153b000647cc37ae.zip gdb-ccda44f92fd49b95bd437a1c153b000647cc37ae.tar.gz gdb-ccda44f92fd49b95bd437a1c153b000647cc37ae.tar.bz2 |
* result.ch, result.exp, Makefile.in: New test case.
* pr-4975.ch, pr-4975-grt.ch, pr-4975.exp, Makefile.in: Ditto.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/gdb.chill/.Sanitize | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.chill/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.chill/Makefile.in | 7 | ||||
-rw-r--r-- | gdb/testsuite/gdb.chill/pr-4975-grt.ch | 13 | ||||
-rw-r--r-- | gdb/testsuite/gdb.chill/pr-4975.ch | 43 | ||||
-rw-r--r-- | gdb/testsuite/gdb.chill/pr-4975.exp | 58 | ||||
-rw-r--r-- | gdb/testsuite/gdb.chill/result.ch | 16 | ||||
-rw-r--r-- | gdb/testsuite/gdb.chill/result.exp | 69 |
8 files changed, 215 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.chill/.Sanitize b/gdb/testsuite/gdb.chill/.Sanitize index fffff90..05a0805 100644 --- a/gdb/testsuite/gdb.chill/.Sanitize +++ b/gdb/testsuite/gdb.chill/.Sanitize @@ -28,10 +28,15 @@ chexp.exp chillvars.ch chillvars.exp configure.in +pr-4975.ch +pr-4975-grt.ch +pr-4975.exp pr-5020.ch pr-5020.exp pr-5022.ch pr-5022.exp +result.ch +result.exp Things-to-lose: diff --git a/gdb/testsuite/gdb.chill/ChangeLog b/gdb/testsuite/gdb.chill/ChangeLog index 3626013..1a6e158 100644 --- a/gdb/testsuite/gdb.chill/ChangeLog +++ b/gdb/testsuite/gdb.chill/ChangeLog @@ -1,3 +1,8 @@ +Tue Jun 14 16:20:18 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * result.ch, result.exp, Makefile.in: New test case. + * pr-4975.ch, pr-4975-grt.ch, pr-4975.exp, Makefile.in: Ditto. + Thu Jun 9 15:20:43 1994 Per Bothner (bothner@kalessin.cygnus.com) * pr-5022.ch, pr-5022.exp: New testcase. diff --git a/gdb/testsuite/gdb.chill/Makefile.in b/gdb/testsuite/gdb.chill/Makefile.in index da50374..6922f85 100644 --- a/gdb/testsuite/gdb.chill/Makefile.in +++ b/gdb/testsuite/gdb.chill/Makefile.in @@ -102,7 +102,12 @@ GDBFLAGS = -nx #### host, target, and site specific Makefile frags come in here. -EXECUTABLES = chillvars.exe pr-5020.exe pr-5022.exe +EXECUTABLES = chillvars.exe result.exe \ + pr-4975.exe pr-5020.exe pr-5022.exe + +# To force pr-4975-grt to be compiled before pr-4975, so the +# latter can use the former's grant file. +pr-4975.o: pr-4975-grt.o all: $(EXECUTABLES) diff --git a/gdb/testsuite/gdb.chill/pr-4975-grt.ch b/gdb/testsuite/gdb.chill/pr-4975-grt.ch new file mode 100644 index 0000000..7796362 --- /dev/null +++ b/gdb/testsuite/gdb.chill/pr-4975-grt.ch @@ -0,0 +1,13 @@ +gdb_bug_grt: MODULE +NEWMODE is_channel_type = SET (chan_1, + chan_2, + chan_3, + chan_4, + chan_5, + chan_6, + chan_7, + chan_8, + chan_9, + chan_10); +GRANT is_channel_type; +END; diff --git a/gdb/testsuite/gdb.chill/pr-4975.ch b/gdb/testsuite/gdb.chill/pr-4975.ch new file mode 100644 index 0000000..dbba064 --- /dev/null +++ b/gdb/testsuite/gdb.chill/pr-4975.ch @@ -0,0 +1,43 @@ +/* +>Number: 4975 +>Category: chill +>Synopsis: Segmentation fault of gdb 4.12.1 +>Description: + + Problem: gdb 4.12.1 segment faults with following chill program. +*/ + +gdb_bug: MODULE + +<> USE_SEIZE_FILE "pr-4975-grt.grt" <> +SEIZE is_channel_type; + + SYNMODE chan_type = POWERSET is_channel_type; + SYN hugo chan_type = [chan_1, chan_3]; + +DCL otto is_channel_type := chan_2; + +x: PROC (); + + IF otto IN hugo THEN + WRITETEXT (STDOUT, "otto IN hugo%/"); + ELSE + WRITETEXT (STDOUT, "You loose%/"); + FI; +END x; + +x (); + +END gdb_bug; +/* +Compiled with: + + chill -S -fgrant-only pr-315-grt.ch + chill -g -o pr-315 pr-315.ch + +Run gdb with + + gdb pr-315 --readnow + +will result in a sigsegv in file gdbtypes.c function force_to_range_type. +*/ diff --git a/gdb/testsuite/gdb.chill/pr-4975.exp b/gdb/testsuite/gdb.chill/pr-4975.exp new file mode 100644 index 0000000..cd11f34 --- /dev/null +++ b/gdb/testsuite/gdb.chill/pr-4975.exp @@ -0,0 +1,58 @@ +# Copyright (C) 1992, 1994 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +# Please email any bugs, comments, and/or additions to this file to: +# bug-gdb@prep.ai.mit.edu + +# This file was written by Per Bothner. (bothner@cygnus.com) + +if $tracelevel then { + strace $tracelevel +} + +proc do_tests {} { + global prms_id bug_id subdir objdir srcdir binfile prompt + + set prms_id 0 + set bug_id 0 + + # Start with a fresh gdb. + + gdb_exit + gdb_start + gdb_reinitialize_dir $srcdir/$subdir + gdb_load $objdir/$subdir/$binfile + + send "set language chill\n" ; expect -re "$prompt $" + + # This is needed (at least on SunOS4) to make sure the + # the symbol table is read. + runto "x" + gdb_test "finish" "You loose" "Runs and reads symbols OK" +} + +# Check to see if we have an executable to test. If not, then either we +# haven't tried to compile one, or the compilation failed for some reason. +# In either case, just notify the user and skip the tests in this file. + +set binfile "pr-4975.exe" +set srcfile $binfile.ch + +if ![file exists $objdir/$subdir/$binfile] then { + warning "$objdir/$subdir/$binfile does not exist; tests suppressed." +} else { + do_tests +} diff --git a/gdb/testsuite/gdb.chill/result.ch b/gdb/testsuite/gdb.chill/result.ch new file mode 100644 index 0000000..71e6400 --- /dev/null +++ b/gdb/testsuite/gdb.chill/result.ch @@ -0,0 +1,16 @@ +test_result: MODULE + + DCL i INT := 5; + + simple_func: PROC () RETURNS (INT); + DCL j INT := i; + RESULT 10; + i + := 2; + RESULT j + 2; + i + := 2; + END simple_func; + + i := simple_func (); + i := simple_func (); + i * := 10; +END test_result; diff --git a/gdb/testsuite/gdb.chill/result.exp b/gdb/testsuite/gdb.chill/result.exp new file mode 100644 index 0000000..ba3f024 --- /dev/null +++ b/gdb/testsuite/gdb.chill/result.exp @@ -0,0 +1,69 @@ +# Copyright (C) 1994 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +# Please email any bugs, comments, and/or additions to this file to: +# bug-gdb@prep.ai.mit.edu + +# This file was written by Per Bothner. (bothner@cygnus.com) + +if $tracelevel then { + strace $tracelevel +} + +proc do_tests {} { + global prms_id bug_id subdir objdir srcdir binfile prompt + + set prms_id 0 + set bug_id 0 + + # Start with a fresh gdb. + + gdb_exit + gdb_start + gdb_reinitialize_dir $srcdir/$subdir + gdb_load $objdir/$subdir/$binfile + + send "set language chill\n" ; expect -re "$prompt $" + + send "set width 0\n" ; expect -re "$prompt $" + send "set print sevenbit-strings\n" ; expect -re "$prompt $" + send "set print address off\n" ; expect -re "$prompt $" + + runto simple_func + send "step 2\n" ; expect -re "$prompt $" + gdb_test "print j" "= 5" + gdb_test "p RESULT" "= 10" + send "continue\n" ; expect -re "$prompt $" + gdb_test "print i" "= 7" + send "step 4\n" ; expect -re "$prompt $" + send "set RESULT := 50\n" ; expect -re "$prompt $" + send "finish\n" ; expect -re "$prompt $" + send "step\n" ; expect -re "$prompt $" + gdb_test "print i" "= 50" +} + +# Check to see if we have an executable to test. If not, then either we +# haven't tried to compile one, or the compilation failed for some reason. +# In either case, just notify the user and skip the tests in this file. + +set binfile "result.exe" +set srcfile $binfile.ch + +if ![file exists $objdir/$subdir/$binfile] then { + warning "$objdir/$subdir/$binfile does not exist; tests suppressed." +} else { + do_tests +} |