about summary refs log tree commit diff
path: root/src/test/debug-info
diff options
context:
space:
mode:
authorBrian Leibig <brian.leibig@gmail.com>2013-02-27 13:35:56 -0500
committerBrian Anderson <banderson@mozilla.com>2013-03-11 14:09:06 -0700
commitc978025d0dc416524313fd0c5f0797d9940574d9 (patch)
treeaac0c6c889f989671b93239a82fa5260647f54c7 /src/test/debug-info
parent3bbcac322669cff3abde5be937cc4ec3860f3985 (diff)
Debuginfo revamp
Diffstat (limited to 'src/test/debug-info')
-rw-r--r--src/test/debug-info/basic-types.rs68
-rw-r--r--src/test/debug-info/struct.rs9
-rw-r--r--src/test/debug-info/tuple.rs (renamed from src/test/debug-info/simple.rs)17
3 files changed, 82 insertions, 12 deletions
diff --git a/src/test/debug-info/basic-types.rs b/src/test/debug-info/basic-types.rs
new file mode 100644
index 00000000000..2441b35bc32
--- /dev/null
+++ b/src/test/debug-info/basic-types.rs
@@ -0,0 +1,68 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Caveats - gdb prints any 8-bit value (meaning rust i8 and u8 values)
+// as its numerical value along with its associated ASCII char, there
+// doesn't seem to be any way around this. Also, gdb doesn't know
+// about UTF-32 character encoding and will print a rust char as only
+// its numerical value.
+
+// compile-flags:-Z extra-debug-info
+// debugger:break 67
+// debugger:run
+// debugger:print b
+// check:$1 = false
+// debugger:print i
+// check:$2 = -1
+// debugger:print c
+// check:$3 = 97
+// debugger:print i8
+// check:$4 = 68 'D'
+// debugger:print i16
+// check:$5 = -16
+// debugger:print i32
+// check:$6 = -32
+// debugger:print i64
+// check:$7 = -64
+// debugger:print u
+// check:$8 = 1
+// debugger:print u8
+// check:$9 = 100 'd'
+// debugger:print u16
+// check:$10 = 16
+// debugger:print u32
+// check:$11 = 32
+// debugger:print u64
+// check:$12 = 64
+// debugger:print f
+// check:$13 = 1.5
+// debugger:print f32
+// check:$14 = 2.5
+// debugger:print f64
+// check:$15 = 3.5
+
+fn main() {
+    let b: bool = false;
+    let i: int = -1;
+    let c: char = 'a';
+    let i8: i8 = 68;
+    let i16: i16 = -16;
+    let i32: i32 = -32;
+    let i64: i64 = -64;
+    let u: uint = 1;
+    let u8: u8 = 100;
+    let u16: u16 = 16;
+    let u32: u32 = 32;
+    let u64: u64 = 64;
+    let f: float = 1.5;
+    let f32: f32 = 2.5;
+    let f64: f64 = 3.5;
+    let _z = ();
+}
diff --git a/src/test/debug-info/struct.rs b/src/test/debug-info/struct.rs
index b3132914477..d376bed76b7 100644
--- a/src/test/debug-info/struct.rs
+++ b/src/test/debug-info/struct.rs
@@ -8,14 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// xfail-test
-// compile-flags:-g
-// debugger:break 32
+// compile-flags:-Z extra-debug-info
+// debugger:break 31
 // debugger:run
 // debugger:print pair
 // check:$1 = {
 // check:x = 1,
-// check:y = 2,
+// check:y = 2
 // check:}
 // debugger:print pair.x
 // check:$2 = 1
@@ -29,5 +28,5 @@ struct Pair {
 
 fn main() {
     let pair = Pair { x: 1, y: 2 };
-    debug!("x = %d, y = %d", pair.x, pair.y);
+    let _z = ();
 }
diff --git a/src/test/debug-info/simple.rs b/src/test/debug-info/tuple.rs
index 51bb177601a..5bceb9916ed 100644
--- a/src/test/debug-info/simple.rs
+++ b/src/test/debug-info/tuple.rs
@@ -8,14 +8,17 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// xfail-test
-// compile-flags:-g
-// debugger:break 20
+// compile-flags:-Z extra-debug-info
+// debugger:break 23
 // debugger:run
-// debugger:print x
-// check:$1 = 42
+// debugger:print t
+// check:$1 = {
+// check:4,
+// check:5.5,
+// check:true
+// check:}
 
 fn main() {
-    let x = 42;
-    debug!("The answer is %d", x);
+    let t = (4, 5.5, true);
+    let _z = ();
 }