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.exp1
-rw-r--r--gdb/testsuite/gdb.rust/simple.rs7
2 files changed, 8 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp
index 846abe1..d70de33 100644
--- a/gdb/testsuite/gdb.rust/simple.exp
+++ b/gdb/testsuite/gdb.rust/simple.exp
@@ -277,6 +277,7 @@ gdb_test "print parametrized.next.val" \
gdb_test "print parametrized" \
" = simple::ParametrizedStruct<i32> \\{next: simple::ParametrizedEnum<\[a-z:\]*Box<simple::ParametrizedStruct<i32>>>::Val\\{val: $hex\\}, value: 0\\}"
+gdb_test "print u" " = simple::Union {f1: -1, f2: 255}"
load_lib gdb-python.exp
if {[skip_python_tests]} {
diff --git a/gdb/testsuite/gdb.rust/simple.rs b/gdb/testsuite/gdb.rust/simple.rs
index b2b5dfe..e5bbe52 100644
--- a/gdb/testsuite/gdb.rust/simple.rs
+++ b/gdb/testsuite/gdb.rust/simple.rs
@@ -80,6 +80,11 @@ struct ParametrizedStruct<T> {
value: T
}
+union Union {
+ f1: i8,
+ f2: u8,
+}
+
fn main () {
let a = ();
let b : [i32; 0] = [];
@@ -153,6 +158,8 @@ fn main () {
value: 0,
};
+ let u = Union { f2: 255 };
+
println!("{}, {}", x.0, x.1); // set breakpoint here
println!("{}", diff2(92, 45));
empty();