diff options
author | Tom Tromey <tromey@adacore.com> | 2023-06-23 06:38:55 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-07-21 09:36:39 -0600 |
commit | b3a27d2f97aa3e21237036e50b54bbe94d19d048 (patch) | |
tree | 1e184ee007848bee5df2020548662f0584b277e4 /gdb/testsuite/gdb.ada | |
parent | 812e7caf60b11c1b9ed09f7d5eda47c2178005dc (diff) | |
download | binutils-b3a27d2f97aa3e21237036e50b54bbe94d19d048.zip binutils-b3a27d2f97aa3e21237036e50b54bbe94d19d048.tar.gz binutils-b3a27d2f97aa3e21237036e50b54bbe94d19d048.tar.bz2 |
Implement Ada target name symbol
Ada 2022 adds the "target name symbol", which can be used on the right
hand side of an assignment to refer to the left hand side. This
allows for convenient updates. This patch implements this for gdb's
Ada expression parser.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Diffstat (limited to 'gdb/testsuite/gdb.ada')
-rw-r--r-- | gdb/testsuite/gdb.ada/assign_1.exp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.ada/assign_1.exp b/gdb/testsuite/gdb.ada/assign_1.exp index d5d8128..8349f53 100644 --- a/gdb/testsuite/gdb.ada/assign_1.exp +++ b/gdb/testsuite/gdb.ada/assign_1.exp @@ -29,3 +29,18 @@ gdb_test "print \$xxx := 1" \ "set convenience variable \$xxx to 1" +gdb_test "print \$xxx := @ + 23 + @" \ + " = 25" \ + "update convenience using '@'" + +gdb_test "print \$yyy := 1" " = 1" "set yyy" + +gdb_test "print \$xxx := @ + (\$yyy := 1 + @)" \ + " = 27" \ + "nested assignment" + +gdb_test "print \$yyy" " = 2" "value of yyy after nested assignment" + +gdb_test "print 23 + @" \ + "may only appear in an assignment context" \ + "invalid use of '@' causes error" |