Support ptype/o in Rust
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.rust / simple.rs
index e5bbe521226cc4869a7d4cf525cf02abf5b1030e..9d89361b75391b5da07b8526f7e7f67c8f652be7 100644 (file)
@@ -85,6 +85,13 @@ union Union {
     f2: u8,
 }
 
+// A simple structure whose layout won't be changed by the compiler,
+// so that ptype/o testing will work on any platform.
+struct SimpleLayout {
+    f1: u16,
+    f2: u16
+}
+
 fn main () {
     let a = ();
     let b : [i32; 0] = [];
@@ -159,6 +166,7 @@ fn main () {
     };
 
     let u = Union { f2: 255 };
+    let v = SimpleLayout { f1: 8, f2: 9 };
 
     println!("{}, {}", x.0, x.1);        // set breakpoint here
     println!("{}", diff2(92, 45));
This page took 0.025308 seconds and 4 git commands to generate.