From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH 2/3] Test attributes with array types
Date: Fri, 08 May 2026 11:34:17 -0600 [thread overview]
Message-ID: <20260508-ada-unop-atr-v1-2-6951c4566b82@adacore.com> (raw)
In-Reply-To: <20260508-ada-unop-atr-v1-0-6951c4566b82@adacore.com>
While looking at code coverage, I noticed that gdb was not testing the
case where certain attributes were applied to an Ada array type. This
patch adds some new tests, improving the coverage.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34043
---
gdb/testsuite/gdb.ada/array_bounds.exp | 8 ++++++++
gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp | 3 +++
2 files changed, 11 insertions(+)
diff --git a/gdb/testsuite/gdb.ada/array_bounds.exp b/gdb/testsuite/gdb.ada/array_bounds.exp
index f9b4fb48cc3..6b9e79ffd00 100644
--- a/gdb/testsuite/gdb.ada/array_bounds.exp
+++ b/gdb/testsuite/gdb.ada/array_bounds.exp
@@ -32,12 +32,20 @@ if {![runto "bar.adb:$bp_location"]} {
gdb_test "print itable'first" \
"= 2"
+gdb_test "print ivector'first" \
+ "= 2"
gdb_test "print itable'last" \
"= 5"
+gdb_test "print ivector'last" \
+ "= 5"
gdb_test "print table'first" \
"= zero"
+gdb_test "print vector'first" \
+ "= zero"
gdb_test "print table'last" \
"= two"
+gdb_test "print vector'last" \
+ "= two"
diff --git a/gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp b/gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp
index f90f1d7acc9..8e359d7bb56 100644
--- a/gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp
+++ b/gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp
@@ -39,6 +39,9 @@ gdb_test "ptype cold'length" "type = <$decimal-byte integer>"
gdb_test "ptype vars'length" "type = <$decimal-byte integer>"
gdb_test "ptype full_table'length" "type = <$decimal-byte integer>"
+gdb_test "print full_table'length" "= 5"
gdb_test "ptype primary_table'length" "type = <$decimal-byte integer>"
+gdb_test "print primary_table'length" " = 3"
gdb_test "ptype variable_table'length" "type = <$decimal-byte integer>"
gdb_test "ptype full_pt'length" "type = <$decimal-byte integer>"
+gdb_test "print full_pt'length" "= 5"
--
2.54.0
next prev parent reply other threads:[~2026-05-08 17:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 17:34 [PATCH 0/3] Improve Ada test coverage Tom Tromey
2026-05-08 17:34 ` [PATCH 1/3] Combine ada_unop_atr and ada_unop_atr_operation::evaluate Tom Tromey
2026-05-08 17:34 ` Tom Tromey [this message]
2026-05-08 17:34 ` [PATCH 3/3] Add test for Ada abs operator Tom Tromey
2026-05-21 17:31 ` [PATCH 0/3] Improve Ada test coverage Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260508-ada-unop-atr-v1-2-6951c4566b82@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox