diff options
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/str_binop_equal.exp | 39 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/str_binop_equal/foo_p211_061.adb | 22 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/str_binop_equal/pck.adb | 22 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/str_binop_equal/pck.ads | 20 |
5 files changed, 107 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 53c3780..50f371b 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2017-12-14 Joel Brobecker <brobecker@adacore.com> + * gdb.ada/str_binop_equal: New testcase. + +2017-12-14 Joel Brobecker <brobecker@adacore.com> + * gdb.ada/task_switch_in_core: New testcase. 2017-12-13 Simon Marchi <simon.marchi@ericsson.com> diff --git a/gdb/testsuite/gdb.ada/str_binop_equal.exp b/gdb/testsuite/gdb.ada/str_binop_equal.exp new file mode 100644 index 0000000..2481bac --- /dev/null +++ b/gdb/testsuite/gdb.ada/str_binop_equal.exp @@ -0,0 +1,39 @@ +# Copyright 2017 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" + +standard_ada_testfile foo_p211_061 + +if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } { + return -1 +} + +clean_restart ${testfile} + +set bp_location [gdb_get_line_number "STOP" ${testdir}/foo_p211_061.adb] +runto "foo_p211_061.adb:$bp_location" + +gdb_test "print my_str = my_str" \ + " = true" + +gdb_test "print my_str = \"ABCD\"" \ + " = true" + +gdb_test "print my_str = \"EFGH\"" \ + " = false" + +gdb_test "print my_str = \"AB\"" \ + " = false" diff --git a/gdb/testsuite/gdb.ada/str_binop_equal/foo_p211_061.adb b/gdb/testsuite/gdb.ada/str_binop_equal/foo_p211_061.adb new file mode 100644 index 0000000..29d6ef8 --- /dev/null +++ b/gdb/testsuite/gdb.ada/str_binop_equal/foo_p211_061.adb @@ -0,0 +1,22 @@ +-- Copyright 2017 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_P211_061 is + My_Str : Str := "ABCD"; +begin + Do_Nothing (My_Str'Address); -- STOP +end Foo_P211_061; diff --git a/gdb/testsuite/gdb.ada/str_binop_equal/pck.adb b/gdb/testsuite/gdb.ada/str_binop_equal/pck.adb new file mode 100644 index 0000000..1518075 --- /dev/null +++ b/gdb/testsuite/gdb.ada/str_binop_equal/pck.adb @@ -0,0 +1,22 @@ +-- Copyright 2017 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/str_binop_equal/pck.ads b/gdb/testsuite/gdb.ada/str_binop_equal/pck.ads new file mode 100644 index 0000000..8578b95 --- /dev/null +++ b/gdb/testsuite/gdb.ada/str_binop_equal/pck.ads @@ -0,0 +1,20 @@ +-- Copyright 2017 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 Str is new String (1 .. 4); + procedure Do_Nothing (A : System.Address); +end pck; |