aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.rust/expr.exp4
-rw-r--r--gdb/testsuite/gdb.rust/simple.exp13
3 files changed, 15 insertions, 8 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e7693a0..daa2839 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2018-11-19 Tom Tromey <tom@tromey.com>
+ PR rust/23625:
+ * gdb.rust/simple.exp: Add ptype test. Update expected output.
+ * gdb.rust/expr.exp: Update expected output. Change one test.
+
+2018-11-19 Tom Tromey <tom@tromey.com>
+
* gdb.rust/simple.rs: Don't initialize empty_enum_value.
2018-11-19 Pedro Alves <palves@redhat.com>
diff --git a/gdb/testsuite/gdb.rust/expr.exp b/gdb/testsuite/gdb.rust/expr.exp
index 22e6b49..ec230c1 100644
--- a/gdb/testsuite/gdb.rust/expr.exp
+++ b/gdb/testsuite/gdb.rust/expr.exp
@@ -134,8 +134,8 @@ gdb_test "ptype \[23usize; 4\]" " = \\\[usize; 4\\\]"
gdb_test "print \[mut 23usize; 4\]" " = \\\[23, 23, 23, 23\\\]"
# Test lexer corner cases.
-gdb_test "print 0x0 as *const ()" " = \\\(\\\(\\\) \\*\\\) 0x0"
-gdb_test "print 0x0 as fn(i64) -> ()" " = \\\(\\\(\\\) \\\(\\*\\\)\\\(i64\\\)\\\) 0x0"
+gdb_test "print 0x0 as *mut ()" " = \\\(\\*mut \\\(\\\)\\\) 0x0"
+gdb_test "print 0x0 as fn(i64) -> ()" " = \\\(\\*mut fn \\\(i64\\\) -> \\\(\\\)\\\) 0x0"
gdb_test "print r#" "syntax error in expression, near `#'\\."
gdb_test "printf \"%d %d\\n\", 23+1, 23-1" "24 22"
diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp
index 956a6ca..f02ff67 100644
--- a/gdb/testsuite/gdb.rust/simple.exp
+++ b/gdb/testsuite/gdb.rust/simple.exp
@@ -54,6 +54,7 @@ gdb_test "print *&c" " = 0"
gdb_test "print *(&c as &i32)" " = 0"
gdb_test "print *(&c as *const i32)" " = 0"
gdb_test "print *(&c as *mut i32)" " = 0"
+gdb_test "ptype &c as *mut i32" "\\*mut i32"
gdb_test "print/c f\[0\]" " = 104 'h'"
@@ -68,8 +69,8 @@ gdb_test "print f" " = \"hi bob\""
gdb_test "print fslice" " = \"bob\""
gdb_test "print &f\[3..\]" " = \"bob\""
-gdb_test "print g" " = \\(u8 \\(\\*\\)\\\[6\\\]\\) $hex b\"hi bob\""
-gdb_test "ptype g" " = u8 \\(\\*\\)\\\[6\\\]"
+gdb_test "print g" " = \\(\\*mut \\\[u8; 6\\\]\\) $hex b\"hi bob\""
+gdb_test "ptype g" " = \\*mut \\\[u8; 6\\\]"
gdb_test "print v" " = simple::Something::Three"
gdb_test_sequence "ptype v" "" {
@@ -91,19 +92,19 @@ gdb_test "print slice as &\[i32\]\[0\]" " = 3"
gdb_test_sequence "ptype slice" "" {
" = struct &\\\[i32\\\] \\{"
- " data_ptr: i32 \\*,"
+ " data_ptr: \\*mut i32,"
" length: usize,"
"\\}"
}
gdb_test_sequence "ptype &slice\[..\]" "" {
" = struct &\\\[i32\\\] \\{"
- " data_ptr: i32 \\*,"
+ " data_ptr: \\*mut i32,"
" length: usize,"
"\\}"
}
gdb_test_sequence "ptype &b\[..\]" "" {
" = struct &\\\[\\*gdb\\*\\\] \\{"
- " data_ptr: i32 \\*,"
+ " data_ptr: \\*mut i32,"
" length: usize,"
"\\}"
}
@@ -281,7 +282,7 @@ gdb_test "print 23..97.0" "Range expression with different types"
gdb_test "print (*parametrized.next.val)" \
" = simple::ParametrizedStruct<i32> {next: simple::ParametrizedEnum<\[a-z:\]*Box<simple::ParametrizedStruct<i32>>>::Empty, value: 1}"
gdb_test "print parametrized.next.val" \
- " = \\(simple::ParametrizedStruct<i32> \\*\\) $hex"
+ " = \\(\\*mut simple::ParametrizedStruct<i32>\\) $hex"
gdb_test "print parametrized" \
" = simple::ParametrizedStruct<i32> \\{next: simple::ParametrizedEnum<\[a-z:\]*Box<simple::ParametrizedStruct<i32>>>::Val\\{val: $hex\\}, value: 0\\}"