1 // Copyright 2013-2014 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.
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.
12 // Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
13 // its numerical value.
16 // min-lldb-version: 310
18 // === GDB TESTS ===================================================================================
21 // gdb-command:print *bool_ref
22 // gdb-check:$1 = true
24 // gdb-command:print *int_ref
27 // gdb-command:print *char_ref
30 // gdb-command:print *i8_ref
31 // gdb-check:$4 = 68 'D'
33 // gdb-command:print *i16_ref
36 // gdb-command:print *i32_ref
39 // gdb-command:print *i64_ref
42 // gdb-command:print *uint_ref
45 // gdb-command:print *u8_ref
46 // gdb-check:$9 = 100 'd'
48 // gdb-command:print *u16_ref
51 // gdb-command:print *u32_ref
54 // gdb-command:print *u64_ref
57 // gdb-command:print *f32_ref
58 // gdb-check:$13 = 2.5
60 // gdb-command:print *f64_ref
61 // gdb-check:$14 = 3.5
64 // === LLDB TESTS ==================================================================================
67 // lldb-command:print *bool_ref
68 // lldb-check:[...]$0 = true
70 // lldb-command:print *int_ref
71 // lldb-check:[...]$1 = -1
73 // NOTE: lldb doesn't support 32bit chars at the moment
74 // d ebugger:print *char_ref
75 // c heck:[...]$x = 97
77 // lldb-command:print *i8_ref
78 // lldb-check:[...]$2 = 'D'
80 // lldb-command:print *i16_ref
81 // lldb-check:[...]$3 = -16
83 // lldb-command:print *i32_ref
84 // lldb-check:[...]$4 = -32
86 // lldb-command:print *i64_ref
87 // lldb-check:[...]$5 = -64
89 // lldb-command:print *uint_ref
90 // lldb-check:[...]$6 = 1
92 // lldb-command:print *u8_ref
93 // lldb-check:[...]$7 = 'd'
95 // lldb-command:print *u16_ref
96 // lldb-check:[...]$8 = 16
98 // lldb-command:print *u32_ref
99 // lldb-check:[...]$9 = 32
101 // lldb-command:print *u64_ref
102 // lldb-check:[...]$10 = 64
104 // lldb-command:print *f32_ref
105 // lldb-check:[...]$11 = 2.5
107 // lldb-command:print *f64_ref
108 // lldb-check:[...]$12 = 3.5
110 #![allow(unused_variables)]
111 #![feature(omit_gdb_pretty_printer_section)]
112 #![omit_gdb_pretty_printer_section]
115 let bool_val: bool = true;
116 let bool_ref: &bool = &bool_val;
118 let int_val: isize = -1;
119 let int_ref: &isize = &int_val;
121 let char_val: char = 'a';
122 let char_ref: &char = &char_val;
125 let i8_ref: &i8 = &i8_val;
127 let i16_val: i16 = -16;
128 let i16_ref: &i16 = &i16_val;
130 let i32_val: i32 = -32;
131 let i32_ref: &i32 = &i32_val;
133 let i64_val: i64 = -64;
134 let i64_ref: &i64 = &i64_val;
136 let uint_val: usize = 1;
137 let uint_ref: &usize = &uint_val;
139 let u8_val: u8 = 100;
140 let u8_ref: &u8 = &u8_val;
142 let u16_val: u16 = 16;
143 let u16_ref: &u16 = &u16_val;
145 let u32_val: u32 = 32;
146 let u32_ref: &u32 = &u32_val;
148 let u64_val: u64 = 64;
149 let u64_ref: &u64 = &u64_val;
151 let f32_val: f32 = 2.5;
152 let f32_ref: &f32 = &f32_val;
154 let f64_val: f64 = 3.5;
155 let f64_ref: &f64 = &f64_val;