Allow subscripting raw pointers
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.rust / simple.rs
index 32da5807b7f3f044e562cce44699950d4b0c0b50..49808261324226cc8110f3a290f211a89eab0672 100644 (file)
@@ -48,6 +48,12 @@ fn diff2(x: i32, y: i32) -> i32 {
     x - y
 }
 
+// Empty function, should not have "void"
+// or "()" in its return type
+fn empty() {
+
+}
+
 pub struct Unit;
 
 // This triggers the non-zero optimization that yields a different
@@ -81,6 +87,7 @@ fn main () {
 
     let v = Something::Three;
     let w = [1,2,3,4];
+    let w_ptr = &w[0];
     let x = (23, 25.5);
     let y = HiBob {field1: 7, field2: 8};
     let z = ByeBob(7, 8);
@@ -111,4 +118,5 @@ fn main () {
 
     println!("{}, {}", x.0, x.1);        // set breakpoint here
     println!("{}", diff2(92, 45));
+    empty();
 }
This page took 0.030227 seconds and 4 git commands to generate.