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.
11 // min-lldb-version: 310
13 // Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
14 // its numerical value.
18 // === GDB TESTS ===================================================================================
22 // gdb-command:print *bool_ref
23 // gdb-check:$1 = true
25 // gdb-command:print *int_ref
28 // gdb-command:print *char_ref
31 // gdb-command:print/d *i8_ref
34 // gdb-command:print *i16_ref
37 // gdb-command:print *i32_ref
40 // gdb-command:print *i64_ref
43 // gdb-command:print *uint_ref
46 // gdb-command:print/d *u8_ref
49 // gdb-command:print *u16_ref
52 // gdb-command:print *u32_ref
55 // gdb-command:print *u64_ref
58 // gdb-command:print *f32_ref
59 // gdb-check:$13 = 2.5
61 // gdb-command:print *f64_ref
62 // gdb-check:$14 = 3.5
65 // === LLDB TESTS ==================================================================================
67 // lldb-command:type format add -f decimal char
68 // lldb-command:type format add -f decimal 'unsigned char'
71 // lldb-command:print *bool_ref
72 // lldb-check:[...]$0 = true
74 // lldb-command:print *int_ref
75 // lldb-check:[...]$1 = -1
77 // d ebugger:print *char_ref
78 // c heck:[...]$3 = 97
80 // lldb-command:print *i8_ref
81 // lldb-check:[...]$2 = 68
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 = 100
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(box_syntax)]
115 #![feature(omit_gdb_pretty_printer_section)]
116 #![omit_gdb_pretty_printer_section]
119 let bool_box: Box<bool> = box true;
120 let bool_ref: &bool = &*bool_box;
122 let int_box: Box<isize> = box -1;
123 let int_ref: &isize = &*int_box;
125 let char_box: Box<char> = box 'a';
126 let char_ref: &char = &*char_box;
128 let i8_box: Box<i8> = box 68;
129 let i8_ref: &i8 = &*i8_box;
131 let i16_box: Box<i16> = box -16;
132 let i16_ref: &i16 = &*i16_box;
134 let i32_box: Box<i32> = box -32;
135 let i32_ref: &i32 = &*i32_box;
137 let i64_box: Box<i64> = box -64;
138 let i64_ref: &i64 = &*i64_box;
140 let uint_box: Box<usize> = box 1;
141 let uint_ref: &usize = &*uint_box;
143 let u8_box: Box<u8> = box 100;
144 let u8_ref: &u8 = &*u8_box;
146 let u16_box: Box<u16> = box 16;
147 let u16_ref: &u16 = &*u16_box;
149 let u32_box: Box<u32> = box 32;
150 let u32_ref: &u32 = &*u32_box;
152 let u64_box: Box<u64> = box 64;
153 let u64_ref: &u64 = &*u64_box;
155 let f32_box: Box<f32> = box 2.5;
156 let f32_ref: &f32 = &*f32_box;
158 let f64_box: Box<f64> = box 3.5;
159 let f64_ref: &f64 = &*f64_box;