]> git.proxmox.com Git - rustc.git/blob - src/test/debug-info/basic-types.rs
Imported Upstream version 0.6
[rustc.git] / src / test / debug-info / basic-types.rs
1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // Caveats - gdb prints any 8-bit value (meaning rust i8 and u8 values)
12 // as its numerical value along with its associated ASCII char, there
13 // doesn't seem to be any way around this. Also, gdb doesn't know
14 // about UTF-32 character encoding and will print a rust char as only
15 // its numerical value.
16
17 // compile-flags:-Z extra-debug-info
18 // debugger:break 67
19 // debugger:run
20 // debugger:print b
21 // check:$1 = false
22 // debugger:print i
23 // check:$2 = -1
24 // debugger:print c
25 // check:$3 = 97
26 // debugger:print i8
27 // check:$4 = 68 'D'
28 // debugger:print i16
29 // check:$5 = -16
30 // debugger:print i32
31 // check:$6 = -32
32 // debugger:print i64
33 // check:$7 = -64
34 // debugger:print u
35 // check:$8 = 1
36 // debugger:print u8
37 // check:$9 = 100 'd'
38 // debugger:print u16
39 // check:$10 = 16
40 // debugger:print u32
41 // check:$11 = 32
42 // debugger:print u64
43 // check:$12 = 64
44 // debugger:print f
45 // check:$13 = 1.5
46 // debugger:print f32
47 // check:$14 = 2.5
48 // debugger:print f64
49 // check:$15 = 3.5
50
51 fn main() {
52 let b: bool = false;
53 let i: int = -1;
54 let c: char = 'a';
55 let i8: i8 = 68;
56 let i16: i16 = -16;
57 let i32: i32 = -32;
58 let i64: i64 = -64;
59 let u: uint = 1;
60 let u8: u8 = 100;
61 let u16: u16 = 16;
62 let u32: u32 = 32;
63 let u64: u64 = 64;
64 let f: float = 1.5;
65 let f32: f32 = 2.5;
66 let f64: f64 = 3.5;
67 let _z = ();
68 }