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
29 // gdbr-check:$3 = 97 'a'
31 // gdb-command:print *i8_ref
32 // gdbg-check:$4 = 68 'D'
35 // gdb-command:print *i16_ref
38 // gdb-command:print *i32_ref
41 // gdb-command:print *i64_ref
44 // gdb-command:print *uint_ref
47 // gdb-command:print *u8_ref
48 // gdbg-check:$9 = 100 'd'
49 // gdbr-check:$9 = 100
51 // gdb-command:print *u16_ref
54 // gdb-command:print *u32_ref
57 // gdb-command:print *u64_ref
60 // gdb-command:print *f32_ref
61 // gdb-check:$13 = 2.5
63 // gdb-command:print *f64_ref
64 // gdb-check:$14 = 3.5
67 // === LLDB TESTS ==================================================================================
70 // lldb-command:print *bool_ref
71 // lldb-check:[...]$0 = true
73 // lldb-command:print *int_ref
74 // lldb-check:[...]$1 = -1
76 // NOTE: lldb doesn't support 32bit chars at the moment
77 // d ebugger:print *char_ref
78 // c heck:[...]$x = 97
80 // lldb-command:print *i8_ref
81 // lldb-check:[...]$2 = 'D'
83 // lldb-command:print *i16_ref
84 // lldb-check:[...]$3 = -16
86 // lldb-command:print *i32_ref
87 // lldb-check:[...]$4 = -32
89 // lldb-command:print *i64_ref
90 // lldb-check:[...]$5 = -64
92 // lldb-command:print *uint_ref
93 // lldb-check:[...]$6 = 1
95 // lldb-command:print *u8_ref
96 // lldb-check:[...]$7 = 'd'
98 // lldb-command:print *u16_ref
99 // lldb-check:[...]$8 = 16
101 // lldb-command:print *u32_ref
102 // lldb-check:[...]$9 = 32
104 // lldb-command:print *u64_ref
105 // lldb-check:[...]$10 = 64
107 // lldb-command:print *f32_ref
108 // lldb-check:[...]$11 = 2.5
110 // lldb-command:print *f64_ref
111 // lldb-check:[...]$12 = 3.5
113 #![allow(unused_variables)]
114 #![feature(omit_gdb_pretty_printer_section)]
115 #![omit_gdb_pretty_printer_section]
118 let bool_val: bool = true;
119 let bool_ref: &bool = &bool_val;
121 let int_val: isize = -1;
122 let int_ref: &isize = &int_val;
124 let char_val: char = 'a';
125 let char_ref: &char = &char_val;
128 let i8_ref: &i8 = &i8_val;
130 let i16_val: i16 = -16;
131 let i16_ref: &i16 = &i16_val;
133 let i32_val: i32 = -32;
134 let i32_ref: &i32 = &i32_val;
136 let i64_val: i64 = -64;
137 let i64_ref: &i64 = &i64_val;
139 let uint_val: usize = 1;
140 let uint_ref: &usize = &uint_val;
142 let u8_val: u8 = 100;
143 let u8_ref: &u8 = &u8_val;
145 let u16_val: u16 = 16;
146 let u16_ref: &u16 = &u16_val;
148 let u32_val: u32 = 32;
149 let u32_ref: &u32 = &u32_val;
151 let u64_val: u64 = 64;
152 let u64_ref: &u64 = &u64_val;
154 let f32_val: f32 = 2.5;
155 let f32_ref: &f32 = &f32_val;
157 let f64_val: f64 = 3.5;
158 let f64_ref: &f64 = &f64_val;