aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.rust
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.rust')
-rw-r--r--gdb/testsuite/gdb.rust/simple.exp2
-rw-r--r--gdb/testsuite/gdb.rust/simple.rs6
2 files changed, 8 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp
index 7211bd2..dcbfb90 100644
--- a/gdb/testsuite/gdb.rust/simple.exp
+++ b/gdb/testsuite/gdb.rust/simple.exp
@@ -309,6 +309,8 @@ gdb_test_sequence "ptype/o SimpleLayout" "" {
" }"
}
+gdb_test "print u2" " = simple::Union2 {name: \\\[1\\\]}"
+
# PR rust/23626 - this used to crash. Note that the results are
# fairly lax because most existing versions of Rust (those before the
# DW_TAG_variant patches) do not emit what gdb wants here; and there
diff --git a/gdb/testsuite/gdb.rust/simple.rs b/gdb/testsuite/gdb.rust/simple.rs
index e6e0efd..65b57f4 100644
--- a/gdb/testsuite/gdb.rust/simple.rs
+++ b/gdb/testsuite/gdb.rust/simple.rs
@@ -85,6 +85,10 @@ union Union {
f2: u8,
}
+pub union Union2 {
+ pub name: [u8; 1],
+}
+
struct StringAtOffset {
pub field1: &'static str,
pub field2: i32,
@@ -180,6 +184,8 @@ fn main () {
let empty_enum_value: EmptyEnum;
+ let u2 = Union2 { name: [1] };
+
println!("{}, {}", x.0, x.1); // set breakpoint here
println!("{}", diff2(92, 45));
empty();