Avoid crash on single-field union in Rust
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.rust / simple.rs
index e6e0efd3b16b9e3fd24eeb905a5c74bd50b450cc..65b57f42df6a7cc38c597875b63cd854dd4193a9 100644 (file)
@@ -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();
This page took 0.02393 seconds and 4 git commands to generate.