diff options
author | Per Bothner <per@bothner.com> | 1995-12-12 00:55:18 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1995-12-12 00:55:18 +0000 |
commit | b44fe1d5e03965eae3cf10c130f960f19e694bd2 (patch) | |
tree | 327d99229356677550655307e37faa151096a44b | |
parent | 339038710b7df20192a350f167c422bcf63b8422 (diff) | |
download | gdb-b44fe1d5e03965eae3cf10c130f960f19e694bd2.zip gdb-b44fe1d5e03965eae3cf10c130f960f19e694bd2.tar.gz gdb-b44fe1d5e03965eae3cf10c130f960f19e694bd2.tar.bz2 |
* tuples.ch, tuples.exp: Exhance test cases (from PR 8643).
-rw-r--r-- | gdb/testsuite/gdb.chill/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.chill/tuples.ch | 21 | ||||
-rw-r--r-- | gdb/testsuite/gdb.chill/tuples.exp | 39 |
3 files changed, 64 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.chill/ChangeLog b/gdb/testsuite/gdb.chill/ChangeLog index cd9c161..27c7d73 100644 --- a/gdb/testsuite/gdb.chill/ChangeLog +++ b/gdb/testsuite/gdb.chill/ChangeLog @@ -1,3 +1,7 @@ +Mon Dec 11 16:53:40 1995 Per Bothner <bothner@kalessin.cygnus.com> + + * tuples.ch, tuples.exp: Exhance test cases (from PR 8643). + Mon Dec 11 06:57:07 1995 Wilfried Moser (Alcatel) <moser@rtl.cygnus.com> * builtins.exp, pr-5016.{ch,exp}, result.{ch,exp}, diff --git a/gdb/testsuite/gdb.chill/tuples.ch b/gdb/testsuite/gdb.chill/tuples.ch index 83381eb..24709f8 100644 --- a/gdb/testsuite/gdb.chill/tuples.ch +++ b/gdb/testsuite/gdb.chill/tuples.ch @@ -63,3 +63,24 @@ printdow( w ); printdow( dow[LOWER(dow) : UPPER(dow)] ); END setmode; + +PR8643: MODULE + +SYNMODE m_set = SET (a, b, c, d); +SYNMODE m_ps = POWERSET m_set; + +SYNMODE m_s1 = STRUCT (str CHARS(40) VARYING, i INT, ps m_ps); +DCL vs1 m_s1; + +SYNMODE m_s2 = STRUCT (i LONG, s m_s1); +DCL vs2 m_s2; + +SYNMODE m_arr = ARRAY (1:3) BYTE; +SYNMODE m_s3 = STRUCT (i LONG, a m_arr); +DCL vs3 m_s3; + +DCL i LONG; + +i := 24; + +END PR8643; diff --git a/gdb/testsuite/gdb.chill/tuples.exp b/gdb/testsuite/gdb.chill/tuples.exp index c1b9472..284dbef 100644 --- a/gdb/testsuite/gdb.chill/tuples.exp +++ b/gdb/testsuite/gdb.chill/tuples.exp @@ -122,6 +122,45 @@ proc do_tests {} { send "set var w:=\[\]\n" ; expect -re "$prompt $" gdb_test "print w" " = \\\[\\\]" \ "print bitstring after assignment of \[\]" + +# These tests are from Cygnus PR chill/8643: + runto tuples.ch:40 + send "set var vs1 := \[ \"foo\", 41, \[ b \] \]\n" ; expect -re "$prompt $" + gdb_test_exact "print vs1" { = [.str: "foo", .i: 41, .ps: [b]]} \ + "print vs1 after tuple assign 1" + send "set var vs1 := \[ \"bar\", 42, m_ps\[ a \] \]\n" + expect -re "$prompt $" + gdb_test_exact "print vs1" { = [.str: "bar", .i: 42, .ps: [a]]} \ + "print vs1 after tuple assign 2" + + send "set var \$i := m_s1\[\"foo\", 42, \[a \]\]\n" + expect -re "$prompt $" + gdb_test_exact {print $i} { = [.str: "foo", .i: 42, .ps: [a]]} \ + "print \$i after tuple assign 1" + send "set var \$i := m_s1\[\"foo\", 44, m_ps\[a \]\]\n" + expect -re "$prompt $" + gdb_test_exact {print $i} { = [.str: "foo", .i: 44, .ps: [a]]} \ + "print \$i after tuple assign 2" + + send "set var vs2 := \[ 10, \[ \"foo\" , 42, \[ b \] \] \]\n" + expect -re "$prompt $" + gdb_test_exact "print vs2" \ + { = [.i: 10, .s: [.str: "foo", .i: 42, .ps: [b]]]} \ + "print vs2 after tuple assign 1" + send "set var vs2 := \[ 10+3, m_s1\[ \"foo\" , 42, m_ps\[ b \] \] \]\n" + expect -re "$prompt $" + gdb_test_exact "print vs2" \ + { = [.i: 13, .s: [.str: "foo", .i: 42, .ps: [b]]]} \ + "print vs2 after tuple assign 1" + + send "set var vs3 := \[ 33, \[ -1, -2, -3 \] \]\n" ; expect -re "$prompt $" + gdb_test_exact "print vs3" {[.i: 33, .a: [(1): -1, (2): -2, (3): -3]]} \ + "print vs3 after tuple assign" + send "set var \$k := m_s3\[ 33, m_arr\[ 4, 3, 2 \] \]\n" + expect -re "$prompt $" + gdb_test_exact {print $k} { = [.i: 33, .a: [(1): 4, (2): 3, (3): 2]]} \ + "print \$k after tuple assign" + } do_tests |