From: Per Bothner Date: Wed, 27 Sep 1995 18:51:33 +0000 (+0000) Subject: * tuples.ch. tuples.exp: Add new test for setting a variant record X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=658f132580200def7724c01623f99b97c2099daf;p=binutils-gdb.git * tuples.ch. tuples.exp: Add new test for setting a variant record using a tuple, and access the fields. --- diff --git a/gdb/testsuite/gdb.chill/ChangeLog b/gdb/testsuite/gdb.chill/ChangeLog index 8a96268bb7d..310670bc2bf 100644 --- a/gdb/testsuite/gdb.chill/ChangeLog +++ b/gdb/testsuite/gdb.chill/ChangeLog @@ -1,3 +1,8 @@ +Wed Sep 27 11:51:50 1995 Per Bothner + + * tuples.ch. tuples.exp: Add new test for setting a variant record + using a tuple, and access the fields. + Thu Aug 3 10:45:37 1995 Fred Fish * Update all FSF addresses except those in COPYING* files. diff --git a/gdb/testsuite/gdb.chill/tuples.ch b/gdb/testsuite/gdb.chill/tuples.ch index 399773ae8b0..83381eb33f2 100644 --- a/gdb/testsuite/gdb.chill/tuples.ch +++ b/gdb/testsuite/gdb.chill/tuples.ch @@ -28,6 +28,15 @@ DCL j r1 := 4; DCL i INT; +newmode vstruct = struct (a, b long, + case b of + (42): ch8 chars(20), + (52): i long + else ch1 char + esac); + +DCL vstr vstruct := [ .a: 10, .b: 52, .i: 100 ]; + i := 0; END x; diff --git a/gdb/testsuite/gdb.chill/tuples.exp b/gdb/testsuite/gdb.chill/tuples.exp index f05a466f7f6..eda79da2998 100644 --- a/gdb/testsuite/gdb.chill/tuples.exp +++ b/gdb/testsuite/gdb.chill/tuples.exp @@ -38,7 +38,7 @@ proc do_tests {} { send "set language chill\n" ; expect -re "$prompt $" - runto tuples.ch:31 + runto tuples.ch:40 gdb_test_exact "print v_arri" {= [(1): -1, (2): -2, (3): -3, (4): -4, (5): -5]} send "set v_arri := \[ 33, 44, 55, 66, 77 \]\n" ; expect -re "$prompt $" @@ -98,6 +98,10 @@ proc do_tests {} { expect -re "$prompt $" gdb_test_exact "print v_arrbool" {= [(1): FALSE, (2:4): TRUE, (5): FALSE]} "v_arrbool after slice assignment 2" + send "set vstr := \[ .a: 2+3, .b: 12, .ch1: 'x' \]\n" + expect -re "$prompt $" + gdb_test_exact "print vstr.a" {= 5} "vstr.a after assignment" + gdb_test_exact "print vstr.ch1" {= 'x'} "vstr.ch1 after assignment" # These tests are from Cygnus PR chill/5024: send "break printdow\n" ; expect -re "$prompt $"