[binutils-gdb] Add test for Ada abs operator
Tom Tromey via Gdb-cvs <[email protected]> Thu, 21 May 2026 17:36:16 +0000 (GMT)
| Newsgroups | gmane.comp.gdb.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ea27a7ae9048367bde15246b248f856803efc674 commit ea27a7ae9048367bde15246b248f856803efc674 Author: Tom Tromey <[email protected]> Date: Fri May 8 10:44:59 2026 -0600 Add test for Ada abs operator There were no tests in the tree for the Ada abs operator, meaning that ada_abs was never invoked during a test. This patch adds a new basic test for this. Note that operator overloading of 'abs' does seem to be tested. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34042 Diff: --- gdb/testsuite/gdb.ada/abs.exp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gdb/testsuite/gdb.ada/abs.exp b/gdb/testsuite/gdb.ada/abs.exp new file mode 100644 index 00000000000..5035604fa86 --- /dev/null +++ b/gdb/testsuite/gdb.ada/abs.exp @@ -0,0 +1,29 @@ +# Copyright 2026 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/>. + +# Simple tests of the 'abs' operator. + +load_lib "ada.exp" + +require allow_ada_tests + +clean_restart + +gdb_test_no_output "set language ada" + +gdb_test "print abs -5" [quotemeta {@DECIMAL = 5}] +gdb_test "print abs 5" [quotemeta {@DECIMAL = 5}] +gdb_test "print abs(-5)" [quotemeta {@DECIMAL = 5}] +gdb_test "print abs(5)" [quotemeta {@DECIMAL = 5}]