rust/25535 Apply embedded offset to enum variant calculation
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.rust / simple.rs
index 1280e04449bae478c916e4beb9361473bb89de05..36448ec45c6e7a76ce97bb10053707d8aabaf8f4 100644 (file)
@@ -104,6 +104,12 @@ struct SimpleLayout {
 
 enum EmptyEnum {}
 
+#[derive(Debug)]
+struct EnumWithNonzeroOffset {
+    a: Option<u8>,
+    b: Option<u8>,
+}
+
 fn main () {
     let a = ();
     let b : [i32; 0] = [];
@@ -186,6 +192,8 @@ fn main () {
 
     let u2 = Union2 { name: [1] };
 
+    let nonzero_offset = EnumWithNonzeroOffset { a: Some(1), b: None };
+
     println!("{}, {}", x.0, x.1);        // set breakpoint here
     println!("{}", diff2(92, 45));
     empty();
This page took 0.028161 seconds and 4 git commands to generate.