* builtins.ch, builtins.exp: Enhance test case.
authorWilfried Moser <moser@cygnus>
Mon, 29 Jan 1996 08:09:04 +0000 (08:09 +0000)
committerWilfried Moser <moser@cygnus>
Mon, 29 Jan 1996 08:09:04 +0000 (08:09 +0000)
        * extstruct.ch, extstruct-grt.ch, extstruct.exp: New test case.

gdb/testsuite/gdb.chill/.Sanitize
gdb/testsuite/gdb.chill/ChangeLog
gdb/testsuite/gdb.chill/builtins.ch
gdb/testsuite/gdb.chill/builtins.exp
gdb/testsuite/gdb.chill/extstruct-grt.ch [new file with mode: 0644]
gdb/testsuite/gdb.chill/extstruct.ch [new file with mode: 0644]
gdb/testsuite/gdb.chill/extstruct.exp [new file with mode: 0644]

index e3b301f6d1a7348f4f238742de3d9ce3f178b752..4189ddff5f88d9998227f9655142a08fb7098a75 100644 (file)
@@ -36,6 +36,9 @@ configure
 configure.in
 enum.ch
 enum.exp
+extstruct.ch
+extstruct-grt.ch
+extstruct.exp
 func1.ch
 misc.ch
 misc.exp
index 5ad556b3bf4ec73e5e500f9d9c88317a87bcad8d..443080bf802c66e9c32cf17d4e92dfecb7476555 100644 (file)
@@ -1,3 +1,9 @@
+Mon Jan 29 00:05:01 1996  Wilfried Moser (Alcatel)  <moser@rtl.cygnus.com>
+
+       * builtins.ch, builtins.exp: Enhance test case.
+
+       * extstruct.ch, extstruct-grt.ch, extstruct.exp: New test case.
+
 Tue Jan 23 16:57:13 1996  Per Bothner  <bothner@kalessin.cygnus.com>
 
        * enum.ch, enum.exp:  New test case (covers PRs 8869 and 8870).
index 6a94b762000a109291e3d4adc320fcb7e66bb43c..ef12c839b90d2adad79f8dc3835c477f8bde5b53 100644 (file)
@@ -16,6 +16,10 @@ DCL v_set m_set INIT := e3;
 SYNMODE m_set_range = m_set(e2:e5);
 DCL v_set_range m_set_range INIT := e3;
 
+SYNMODE m_numbered_set = SET (n1 = 25, n2 = 22, n3 = 35, n4 = 33,
+                             n5 = 45, n6 = 43);
+DCL v_numbered_set m_numbered_set INIT := n3;
+
 SYNMODE m_char_range = CHAR('A':'Z');
 DCL v_char_range m_char_range INIT := 'G';
 
@@ -51,6 +55,9 @@ DCL v_int_arr ARRAY (INT) BYTE;
 SYNMODE m_set_arr = ARRAY (m_set) BYTE;
 DCL v_set_arr ARRAY (m_set) BYTE;
 
+SYNMODE m_numbered_set_arr = ARRAY (m_numbered_set) BYTE;
+DCL v_numbered_set_arr ARRAY (m_numbered_set) BYTE;
+
 SYNMODE m_char_range_arr = ARRAY (m_char_range) BYTE;
 DCL v_char_range_arr ARRAY (m_char_range) BYTE;
 
index 820b54025570af064c2aa39a3e060066b1ee0f90..f588fe29e1b57abcf20fa3f5f0457517708b4aae 100644 (file)
@@ -128,6 +128,7 @@ proc test_lower {} {
     test_print_accept "print lower(ulong)" "0"
     test_print_accept "print lower(m_set)" "e1"
     test_print_accept "print lower(m_set_range)" "e2"
+    test_print_accept "print lower(m_numbered_set)" "n2"
     test_print_accept "print lower(m_char_range)" "'A'"
     test_print_accept "print lower(m_bool_range)" "FALSE"
     test_print_accept "print lower(m_long_range)" "255"
@@ -149,6 +150,7 @@ proc test_lower {} {
     test_print_accept "print lower(v_ulong)" "0"
     test_print_accept "print lower(v_set)" "e1"
     test_print_accept "print lower(v_set_range)" "e2"
+    test_print_accept "print lower(v_numbered_set)" "n2"
     test_print_accept "print lower(v_char_range)" "'A'"
     test_print_accept "print lower(v_bool_range)" "FALSE"
     test_print_accept "print lower(v_long_range)" "255"
@@ -179,6 +181,7 @@ proc test_lower {} {
     }
     test_print_accept "print lower(m_set_arr)" "e1"
     test_print_accept "print lower(m_set_range_arr)" "e2"
+    test_print_accept "print lower(m_numbered_set_arr)" "n2"
     test_print_accept "print lower(m_char_range_arr)" "'A'"
     test_print_accept "print lower(m_bool_range_arr)" "FALSE"
     test_print_accept "print lower(m_long_range_arr)" "255"
@@ -195,6 +198,7 @@ proc test_lower {} {
     }
     test_print_accept "print lower(v_set_arr)" "e1"
     test_print_accept "print lower(v_set_range_arr)" "e2"
+    test_print_accept "print lower(v_numbered_set_arr)" "n2"
     test_print_accept "print lower(v_char_range_arr)" "'A'"
     test_print_accept "print lower(v_bool_range_arr)" "FALSE"
     test_print_accept "print lower(v_long_range_arr)" "255"
@@ -226,6 +230,7 @@ proc test_upper {} {
     }
     test_print_accept "print upper(m_set)" "e6"
     test_print_accept "print upper(m_set_range)" "e5"
+    test_print_accept "print upper(m_numbered_set)" "n5"
     test_print_accept "print upper(m_char_range)" "'Z'"
     test_print_accept "print upper(m_bool_range)" "FALSE"
     test_print_accept "print upper(m_long_range)" "3211"
@@ -250,6 +255,7 @@ proc test_upper {} {
     }
     test_print_accept "print upper(v_set)" "e6"
     test_print_accept "print upper(v_set_range)" "e5"
+    test_print_accept "print upper(v_numbered_set)" "n5"
     test_print_accept "print upper(v_char_range)" "'Z'"
     test_print_accept "print upper(v_bool_range)" "FALSE"
     test_print_accept "print upper(v_long_range)" "3211"
@@ -280,6 +286,7 @@ proc test_upper {} {
     }
     test_print_accept "print upper(m_set_arr)" "e6"
     test_print_accept "print upper(m_set_range_arr)" "e5"
+    test_print_accept "print upper(m_numbered_set_arr)" "n5"
     test_print_accept "print upper(m_char_range_arr)" "'Z'"
     test_print_accept "print upper(m_bool_range_arr)" "FALSE"
     test_print_accept "print upper(m_long_range_arr)" "3211"
@@ -296,6 +303,7 @@ proc test_upper {} {
     }
     test_print_accept "print upper(v_set_arr)" "e6"
     test_print_accept "print upper(v_set_range_arr)" "e5"
+    test_print_accept "print upper(v_numbered_set_arr)" "n5"
     test_print_accept "print upper(v_char_range_arr)" "'Z'"
     test_print_accept "print upper(v_bool_range_arr)" "FALSE"
     test_print_accept "print upper(v_long_range_arr)" "3211"
@@ -351,6 +359,7 @@ proc test_size {} {
        test_print_accept "print size(m_struct)" "36"
     }
     test_print_accept "print size(m_set)" "1"
+    test_print_accept "print size(m_numbered_set)" "1"
     test_print_accept "print size(m_char_range)" "1"
     test_print_accept "print size(m_range_arr)" "17"
     test_print_accept "print size(m_chars)" "20"
@@ -374,6 +383,7 @@ proc test_size {} {
        test_print_accept "print size(v_struct)" "36"
     }
     test_print_accept "print size(v_set)" "1"
+    test_print_accept "print size(v_numbered_set)" "1"
     test_print_accept "print size(v_char_range)" "1"
     test_print_accept "print size(v_range_arr)" "17"
     test_print_accept "print size(v_chars)" "20"
@@ -405,6 +415,7 @@ proc test_num {} {
     test_print_accept "print num(v_ulong)" "4444"
     test_print_accept "print num(v_set)" "2"
     test_print_accept "print num(v_set_range)" "2"
+    test_print_accept "print num(v_numbered_set)" "35"
     test_print_accept "print num(v_char_range)" "71"
     test_print_accept "print num(v_long_range)" "1000"
     test_print_accept "print num(v_range)" "23"
diff --git a/gdb/testsuite/gdb.chill/extstruct-grt.ch b/gdb/testsuite/gdb.chill/extstruct-grt.ch
new file mode 100644 (file)
index 0000000..abd0d5e
--- /dev/null
@@ -0,0 +1,12 @@
+pot1: MODULE
+
+SYNMODE m_array1 = ARRAY (2:3) ulong;
+SYNMODE m_struct = STRUCT (f1 int,
+                          f2 REF m_array1,
+                          f3 m_array1);
+SYNMODE m_array3 = ARRAY (5:6) m_struct;
+SYNMODE m_array4 = ARRAY (7:8) ARRAY (9:10) m_struct;
+
+GRANT all;
+
+END pot1;
diff --git a/gdb/testsuite/gdb.chill/extstruct.ch b/gdb/testsuite/gdb.chill/extstruct.ch
new file mode 100644 (file)
index 0000000..649f609
--- /dev/null
@@ -0,0 +1,16 @@
+pottendo: MODULE
+
+<> USE_SEIZE_FILE "extstruct-grt.grt" <>
+SEIZE m_array3;
+SEIZE m_array4;
+
+SYNMODE m_x = STRUCT (i long,
+                     ar m_array3);
+SYNMODE m_y = STRUCT (i long,
+                     ar m_array4);
+
+DCL x LONG;
+
+x := 10;
+
+END pottendo;
diff --git a/gdb/testsuite/gdb.chill/extstruct.exp b/gdb/testsuite/gdb.chill/extstruct.exp
new file mode 100644 (file)
index 0000000..6ef4b9a
--- /dev/null
@@ -0,0 +1,65 @@
+# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile2 "extstruct-grt"
+set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
+if  { [compile "${srcfile2} -g -c"] != "" } {
+    perror "Couldn't compile ${srcfile2}"
+    return -1
+}
+
+set testfile "extstruct"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if  { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+    perror "Couldn't compile ${srcfile}"
+    return -1
+}
+
+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 $binfile
+
+    send "set language chill\n" ; expect -re "$prompt $"
+
+    send "set var \$i := m_x\[\]\n" ; expect -re "$prompt $"
+    gdb_test "print \$i" { = \[.i: 0, .ar: \[\(5:6\): \[.f1: 0, .f2: NULL, .f3: \[\(2:3\): 0\]\]\]\]}
+
+    send "set var \$j := m_y\[\]\n" ; expect -re "$prompt $"
+    gdb_test "print \$j" { = \[.i: 0, .ar: \[\(7:8\): \[\(9:10\): \[.f1: 0, .f2: NULL, .f3: \[\(2:3\): 0\]\]\]\]\]}
+}
+
+do_tests
This page took 0.028129 seconds and 4 git commands to generate.