aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.rust/simple.exp19
2 files changed, 23 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index edc5079..296878c 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2017-10-02 Tom Tromey <tom@tromey.com>
+ * gdb.rust/simple.exp: Test ptype of a slice.
+
+2017-10-02 Tom Tromey <tom@tromey.com>
+
* gdb.rust/simple.exp: Test index of slice.
2017-09-27 Tom Tromey <tom@tromey.com>
diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp
index 1a46317..b01841f 100644
--- a/gdb/testsuite/gdb.rust/simple.exp
+++ b/gdb/testsuite/gdb.rust/simple.exp
@@ -85,6 +85,25 @@ gdb_test "print fromslice" " = 3"
gdb_test "print slice\[0\]" " = 3"
gdb_test "print slice as &\[i32\]\[0\]" " = 3"
+gdb_test_sequence "ptype slice" "" {
+ " = struct &\\\[i32\\\] \\{"
+ " data_ptr: i32 \\*,"
+ " length: usize,"
+ "\\}"
+}
+gdb_test_sequence "ptype &slice\[..\]" "" {
+ " = struct &\\\[i32\\\] \\{"
+ " data_ptr: i32 \\*,"
+ " length: usize,"
+ "\\}"
+}
+gdb_test_sequence "ptype &b\[..\]" "" {
+ " = struct &\\\[\\*gdb\\*\\\] \\{"
+ " data_ptr: i32 \\*,"
+ " length: usize,"
+ "\\}"
+}
+
gdb_test "print x" " = \\(23, 25\\.5\\)"
gdb_test "ptype x" " = \\(i32, f64\\)"
gdb_test "print x as (i32,f64)" " = \\(23, 25\\.5\\)"