aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-03-16 09:50:17 -0600
committerTom Tromey <tromey@adacore.com>2022-03-17 06:46:13 -0600
commitd32cbc04e31098d69a299f608424a5fcb69aae7a (patch)
treebd288e5e582683e22b14a796cbe947d55e905b5c
parentc9178f285acf19e066be8367185d52837161b0a2 (diff)
downloadgdb-d32cbc04e31098d69a299f608424a5fcb69aae7a.zip
gdb-d32cbc04e31098d69a299f608424a5fcb69aae7a.tar.gz
gdb-d32cbc04e31098d69a299f608424a5fcb69aae7a.tar.bz2
Add another test for Ada Wide_Wide_String
In an earlier patch, I had written that I wanted to add this test: ptype Wide_Wide_String'("literal") ... but that it failed with the distro GNAT. Further investigation showed that it could be made to work by adding a function using Wide_Wide_String to the program -- this caused the type to end up in the debug info. This patch adds the test. I'm checking this in.
-rw-r--r--gdb/testsuite/gdb.ada/widewide.exp3
-rw-r--r--gdb/testsuite/gdb.ada/widewide/foo.adb3
-rw-r--r--gdb/testsuite/gdb.ada/widewide/pck.adb10
-rw-r--r--gdb/testsuite/gdb.ada/widewide/pck.ads2
4 files changed, 17 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.ada/widewide.exp b/gdb/testsuite/gdb.ada/widewide.exp
index 2f14a0f..56c9e12 100644
--- a/gdb/testsuite/gdb.ada/widewide.exp
+++ b/gdb/testsuite/gdb.ada/widewide.exp
@@ -59,3 +59,6 @@ gdb_test "print my_wws" " = \"bcllo\"" \
gdb_test "print 'x' & my_ws" " = \"xwide\""
gdb_test "print my_ws & 'y'" " = \"widey\""
+
+gdb_test "ptype wide_wide_string'(\"wws\")" \
+ "array \\(1 \\.\\. 3\\) of wide_wide_character"
diff --git a/gdb/testsuite/gdb.ada/widewide/foo.adb b/gdb/testsuite/gdb.ada/widewide/foo.adb
index d41734a..eda6ac5 100644
--- a/gdb/testsuite/gdb.ada/widewide/foo.adb
+++ b/gdb/testsuite/gdb.ada/widewide/foo.adb
@@ -24,6 +24,7 @@ procedure Foo is
begin
Do_Nothing (Some_Easy'Address); -- START
Do_Nothing (Some_Larger'Address);
- Do_Nothing (My_Ws'Address);
+ Do_Nothing (My_Ws);
+ Do_Nothing (My_WWS);
Do_Nothing (Some_Big'Address);
end Foo;
diff --git a/gdb/testsuite/gdb.ada/widewide/pck.adb b/gdb/testsuite/gdb.ada/widewide/pck.adb
index 6b9023b..f5ec560 100644
--- a/gdb/testsuite/gdb.ada/widewide/pck.adb
+++ b/gdb/testsuite/gdb.ada/widewide/pck.adb
@@ -20,4 +20,14 @@ package body Pck is
null;
end Do_Nothing;
+ procedure Do_Nothing (A : Wide_String) is
+ begin
+ null;
+ end Do_Nothing;
+
+ procedure Do_Nothing (A : Wide_Wide_String) is
+ begin
+ null;
+ end Do_Nothing;
+
end Pck;
diff --git a/gdb/testsuite/gdb.ada/widewide/pck.ads b/gdb/testsuite/gdb.ada/widewide/pck.ads
index e9316b0..90c04f3 100644
--- a/gdb/testsuite/gdb.ada/widewide/pck.ads
+++ b/gdb/testsuite/gdb.ada/widewide/pck.ads
@@ -18,5 +18,7 @@ with System;
package Pck is
procedure Do_Nothing (A : System.Address);
+ procedure Do_Nothing (A : Wide_String);
+ procedure Do_Nothing (A : Wide_Wide_String);
end Pck;