From: Per Bothner Date: Tue, 12 Dec 1995 00:55:18 +0000 (+0000) Subject: * tuples.ch, tuples.exp: Exhance test cases (from PR 8643). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b44fe1d5e03965eae3cf10c130f960f19e694bd2;p=binutils-gdb.git * tuples.ch, tuples.exp: Exhance test cases (from PR 8643). --- diff --git a/gdb/testsuite/gdb.chill/ChangeLog b/gdb/testsuite/gdb.chill/ChangeLog index cd9c1613d22..27c7d73d904 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 + + * tuples.ch, tuples.exp: Exhance test cases (from PR 8643). + Mon Dec 11 06:57:07 1995 Wilfried Moser (Alcatel) * 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 83381eb33f2..24709f8fe05 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 c1b9472751b..284dbef82ed 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