From 3654c0672f3181c64f67a5b1b59dc9e6f048675f Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Mon, 6 Mar 1995 22:11:17 +0000 Subject: [PATCH] * tuples.ch (setnmode); New module. * tuples.exp: Add some extra tests. These are from PR 5024. --- gdb/testsuite/gdb.chill/ChangeLog | 5 +++++ gdb/testsuite/gdb.chill/tuples.ch | 23 +++++++++++++++++++++++ gdb/testsuite/gdb.chill/tuples.exp | 11 +++++++++++ 3 files changed, 39 insertions(+) diff --git a/gdb/testsuite/gdb.chill/ChangeLog b/gdb/testsuite/gdb.chill/ChangeLog index 548e4a84ea6..9c725b01755 100644 --- a/gdb/testsuite/gdb.chill/ChangeLog +++ b/gdb/testsuite/gdb.chill/ChangeLog @@ -1,3 +1,8 @@ +Mon Mar 6 14:11:01 1995 Per Bothner + + * tuples.ch (setnmode); New module. + * tuples.exp: Add some extra tests. + Sat Mar 4 15:16:17 1995 Per Bothner * callch.ch, callch.exp, Makefile.in: New test case. diff --git a/gdb/testsuite/gdb.chill/tuples.ch b/gdb/testsuite/gdb.chill/tuples.ch index e1063f5cd1d..399773ae8b0 100644 --- a/gdb/testsuite/gdb.chill/tuples.ch +++ b/gdb/testsuite/gdb.chill/tuples.ch @@ -31,3 +31,26 @@ DCL i INT; i := 0; END x; + +setmode: MODULE /* This is from Cygnus PR chill/5024. */ + +NEWMODE day = SET( monday, tuesday, wednesday, thursday, friday, saturday, sunday ); +NEWMODE dow = POWERSET day; + +DCL d day; +DCL w dow; + +printdow: PROC( w dow ); + DCL d day; + DO FOR d in w; + WRITETEXT( stdout, "%C ", d ); + OD; +END; + +d := monday; +w := dow[monday : friday]; +printdow( w ); + +printdow( dow[LOWER(dow) : UPPER(dow)] ); + +END setmode; diff --git a/gdb/testsuite/gdb.chill/tuples.exp b/gdb/testsuite/gdb.chill/tuples.exp index 8d5bc2ab4b6..4f7803a8a90 100644 --- a/gdb/testsuite/gdb.chill/tuples.exp +++ b/gdb/testsuite/gdb.chill/tuples.exp @@ -97,6 +97,17 @@ proc do_tests {} { send "set v_arrbool(3 : 5) := \[ true, true, false \]\n" expect -re "$prompt $" gdb_test_exact "print v_arrbool" {= [(1): FALSE, (2:4): TRUE, (5): FALSE]} "v_arrbool after slice assignment 2" + + +# These tests are from Cygnus PR chill/5024: + send "break printdow\n" ; expect -re "$prompt $" + send "continue\n" ; expect -re "$prompt $" + send "set var w:= dow\[monday\]\n" ; expect -re "$prompt $" + test_print_accept "print w" "\\\[monday\\\]" \ + "print bitstring after assignment" + send "set var w:=\[\]\n" ; expect -re "$prompt $" + test_print_accept "print w" "\\\[\\\]" \ + "print bitstring after assignment of \[\]" } # Check to see if we have an executable to test. If not, then either we -- 2.30.2