aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.ada/arrayidx.exp4
-rw-r--r--gdb/testsuite/gdb.ada/enum_idx_packed.exp38
-rw-r--r--gdb/testsuite/gdb.ada/enum_idx_packed/foo.adb24
-rw-r--r--gdb/testsuite/gdb.ada/enum_idx_packed/pck.adb21
-rw-r--r--gdb/testsuite/gdb.ada/enum_idx_packed/pck.ads23
6 files changed, 113 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index af77953..2ff685a 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2012-02-29 Joel Brobecker <brobecker@adacore.com>
+ * gdb.ada/arrayidx.exp: Adjust expected output for p_one_two_three.
+ * gdb.ada/enum_idx_packed: New testcase.
+
+2012-02-29 Joel Brobecker <brobecker@adacore.com>
+
* gdb.ada/aliased_array: New testcase.
2012-02-29 Joel Brobecker <brobecker@adacore.com>
diff --git a/gdb/testsuite/gdb.ada/arrayidx.exp b/gdb/testsuite/gdb.ada/arrayidx.exp
index f8c087d..dd61a60 100644
--- a/gdb/testsuite/gdb.ada/arrayidx.exp
+++ b/gdb/testsuite/gdb.ada/arrayidx.exp
@@ -53,7 +53,7 @@ gdb_test "print u_one_two_three" \
"print u_one_two_three, indexes off"
gdb_test "print p_one_two_three" \
- "= \\(0 => false, true, true\\)" \
+ "= \\(false, true, true\\)" \
"print p_one_two_three, indexes off"
gdb_test "print few_reps" \
@@ -89,7 +89,7 @@ gdb_test "print u_one_two_three" \
"print u_one_two_three"
gdb_test "print p_one_two_three" \
- "= \\(0 => false, 1 => true, 2 => true\\)" \
+ "= \\(one => false, two => true, three => true\\)" \
"print p_one_two_three"
gdb_test "print few_reps" \
diff --git a/gdb/testsuite/gdb.ada/enum_idx_packed.exp b/gdb/testsuite/gdb.ada/enum_idx_packed.exp
new file mode 100644
index 0000000..61284bb2
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/enum_idx_packed.exp
@@ -0,0 +1,38 @@
+# Copyright 2012 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 3 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, see <http://www.gnu.org/licenses/>.
+
+load_lib "ada.exp"
+
+if { [skip_ada_tests] } { return -1 }
+
+set testdir "enum_idx_packed"
+set testfile "${testdir}/foo"
+set srcfile ${srcdir}/${subdir}/${testfile}.adb
+set binfile ${objdir}/${subdir}/${testfile}
+
+file mkdir ${objdir}/${subdir}/${testdir}
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
+ return -1
+}
+
+clean_restart ${testfile}
+
+set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
+runto "foo.adb:$bp_location"
+
+gdb_test "print full" " = \\(false, true, false, true, false\\)"
+
+gdb_test "print full'first" " = black"
+
diff --git a/gdb/testsuite/gdb.ada/enum_idx_packed/foo.adb b/gdb/testsuite/gdb.ada/enum_idx_packed/foo.adb
new file mode 100644
index 0000000..a8a0b91
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/enum_idx_packed/foo.adb
@@ -0,0 +1,24 @@
+-- Copyright 2012 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 3 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, see <http://www.gnu.org/licenses/>.
+
+with Pck; use Pck;
+
+procedure Foo is
+ Full : Full_Table := (False, True, False, True, False);
+begin
+ Do_Nothing (Full'Address); -- STOP
+end Foo;
+
+
diff --git a/gdb/testsuite/gdb.ada/enum_idx_packed/pck.adb b/gdb/testsuite/gdb.ada/enum_idx_packed/pck.adb
new file mode 100644
index 0000000..1f7d45c
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/enum_idx_packed/pck.adb
@@ -0,0 +1,21 @@
+-- Copyright 2012 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 3 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, see <http://www.gnu.org/licenses/>.
+
+package body Pck is
+ procedure Do_Nothing (A : System.Address) is
+ begin
+ null;
+ end Do_Nothing;
+end Pck;
diff --git a/gdb/testsuite/gdb.ada/enum_idx_packed/pck.ads b/gdb/testsuite/gdb.ada/enum_idx_packed/pck.ads
new file mode 100644
index 0000000..cba9eda
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/enum_idx_packed/pck.ads
@@ -0,0 +1,23 @@
+-- Copyright 2012 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 3 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, see <http://www.gnu.org/licenses/>.
+
+with System;
+package Pck is
+ type Color is (Black, Red, Green, Blue, White);
+ type Full_Table is array (Color) of Boolean;
+ pragma Pack (Full_Table);
+
+ procedure Do_Nothing (A : System.Address);
+end Pck;