diff options
Diffstat (limited to 'gdb/testsuite/gdb.ada')
-rw-r--r-- | gdb/testsuite/gdb.ada/same_enum.exp | 37 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/same_enum/a.adb | 24 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/same_enum/pck.adb | 22 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/same_enum/pck.ads | 24 |
4 files changed, 107 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.ada/same_enum.exp b/gdb/testsuite/gdb.ada/same_enum.exp new file mode 100644 index 0000000..3f8b372 --- /dev/null +++ b/gdb/testsuite/gdb.ada/same_enum.exp @@ -0,0 +1,37 @@ +# Copyright 2011 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" + +set testdir "same_enum" +set testfile "${testdir}/a" +set srcfile ${srcdir}/${subdir}/${testfile}.adb +set binfile ${objdir}/${subdir}/${testfile} + +file mkdir ${objdir}/${subdir}/${testdir} +if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } { + return -1 +} + +clean_restart ${testfile} + +# Try printing the value of the enumeral `red'. This is normally +# ambiguous, as there are two distinct types that define that +# littleral. But, from a practical standpoint, it doesn't matter +# which one we pick, since both have the same value (in most cases, +# it's because the two types are strongly related). +gdb_test "print red" "= red" + + diff --git a/gdb/testsuite/gdb.ada/same_enum/a.adb b/gdb/testsuite/gdb.ada/same_enum/a.adb new file mode 100644 index 0000000..094fe76 --- /dev/null +++ b/gdb/testsuite/gdb.ada/same_enum/a.adb @@ -0,0 +1,24 @@ +-- Copyright 2011 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 A is + FC : Color := Red; + SC : Color := Green; +begin + Do_Nothing (FC'Address); + Do_Nothing (SC'Address); +end A; diff --git a/gdb/testsuite/gdb.ada/same_enum/pck.adb b/gdb/testsuite/gdb.ada/same_enum/pck.adb new file mode 100644 index 0000000..01fdc3d --- /dev/null +++ b/gdb/testsuite/gdb.ada/same_enum/pck.adb @@ -0,0 +1,22 @@ +-- Copyright 2011 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/same_enum/pck.ads b/gdb/testsuite/gdb.ada/same_enum/pck.ads new file mode 100644 index 0000000..01da514 --- /dev/null +++ b/gdb/testsuite/gdb.ada/same_enum/pck.ads @@ -0,0 +1,24 @@ +-- Copyright 2011 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 RGB_Color is new Color range Red .. Blue; + + procedure Do_Nothing (A : System.Address); +end Pck; + |