1 // Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
2 // its numerical value.
5 // min-lldb-version: 310
7 // === GDB TESTS ===================================================================================
10 // gdb-command:print *bool_ref
11 // gdb-check:$1 = true
13 // gdb-command:print *int_ref
16 // gdb-command:print *char_ref
18 // gdbr-check:$3 = 97 'a'
20 // gdb-command:print *i8_ref
21 // gdbg-check:$4 = 68 'D'
24 // gdb-command:print *i16_ref
27 // gdb-command:print *i32_ref
30 // gdb-command:print *i64_ref
33 // gdb-command:print *uint_ref
36 // gdb-command:print *u8_ref
37 // gdbg-check:$9 = 100 'd'
38 // gdbr-check:$9 = 100
40 // gdb-command:print *u16_ref
43 // gdb-command:print *u32_ref
46 // gdb-command:print *u64_ref
49 // gdb-command:print *f32_ref
50 // gdb-check:$13 = 2.5
52 // gdb-command:print *f64_ref
53 // gdb-check:$14 = 3.5
56 // === LLDB TESTS ==================================================================================
59 // lldb-command:print *bool_ref
60 // lldbg-check:[...]$0 = true
61 // lldbr-check:(bool) *bool_ref = true
63 // lldb-command:print *int_ref
64 // lldbg-check:[...]$1 = -1
65 // lldbr-check:(isize) *int_ref = -1
67 // NOTE: only rust-enabled lldb supports 32bit chars
68 // lldbr-command:print *char_ref
69 // lldbr-check:(char) *char_ref = 'a'
71 // lldb-command:print *i8_ref
72 // lldbg-check:[...]$2 = 'D'
73 // lldbr-check:(i8) *i8_ref = 68
75 // lldb-command:print *i16_ref
76 // lldbg-check:[...]$3 = -16
77 // lldbr-check:(i16) *i16_ref = -16
79 // lldb-command:print *i32_ref
80 // lldbg-check:[...]$4 = -32
81 // lldbr-check:(i32) *i32_ref = -32
83 // lldb-command:print *i64_ref
84 // lldbg-check:[...]$5 = -64
85 // lldbr-check:(i64) *i64_ref = -64
87 // lldb-command:print *uint_ref
88 // lldbg-check:[...]$6 = 1
89 // lldbr-check:(usize) *uint_ref = 1
91 // lldb-command:print *u8_ref
92 // lldbg-check:[...]$7 = 'd'
93 // lldbr-check:(u8) *u8_ref = 100
95 // lldb-command:print *u16_ref
96 // lldbg-check:[...]$8 = 16
97 // lldbr-check:(u16) *u16_ref = 16
99 // lldb-command:print *u32_ref
100 // lldbg-check:[...]$9 = 32
101 // lldbr-check:(u32) *u32_ref = 32
103 // lldb-command:print *u64_ref
104 // lldbg-check:[...]$10 = 64
105 // lldbr-check:(u64) *u64_ref = 64
107 // lldb-command:print *f32_ref
108 // lldbg-check:[...]$11 = 2.5
109 // lldbr-check:(f32) *f32_ref = 2.5
111 // lldb-command:print *f64_ref
112 // lldbg-check:[...]$12 = 3.5
113 // lldbr-check:(f64) *f64_ref = 3.5
115 #![allow(unused_variables)]
116 #![feature(omit_gdb_pretty_printer_section)]
117 #![omit_gdb_pretty_printer_section]
120 let bool_val: bool = true;
121 let bool_ref: &bool = &bool_val;
123 let int_val: isize = -1;
124 let int_ref: &isize = &int_val;
126 let char_val: char = 'a';
127 let char_ref: &char = &char_val;
130 let i8_ref: &i8 = &i8_val;
132 let i16_val: i16 = -16;
133 let i16_ref: &i16 = &i16_val;
135 let i32_val: i32 = -32;
136 let i32_ref: &i32 = &i32_val;
138 let i64_val: i64 = -64;
139 let i64_ref: &i64 = &i64_val;
141 let uint_val: usize = 1;
142 let uint_ref: &usize = &uint_val;
144 let u8_val: u8 = 100;
145 let u8_ref: &u8 = &u8_val;
147 let u16_val: u16 = 16;
148 let u16_ref: &u16 = &u16_val;
150 let u32_val: u32 = 32;
151 let u32_ref: &u32 = &u32_val;
153 let u64_val: u64 = 64;
154 let u64_ref: &u64 = &u64_val;
156 let f32_val: f32 = 2.5;
157 let f32_ref: &f32 = &f32_val;
159 let f64_val: f64 = 3.5;
160 let f64_ref: &f64 = &f64_val;