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 // 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.
17 // min-lldb-version: 310
19 // This fails on lldb 6.0.1 on x86-64 Fedora 28; so mark it macOS-only
25 // === GDB TESTS ===================================================================================
28 // gdb-command:print b
29 // gdb-check:$1 = false
30 // gdb-command:print i
32 // gdb-command:print c
34 // gdbr-check:$3 = 97 'a'
35 // gdb-command:print/d i8
37 // gdb-command:print i16
39 // gdb-command:print i32
41 // gdb-command:print i64
43 // gdb-command:print u
45 // gdb-command:print/d u8
47 // gdb-command:print u16
49 // gdb-command:print u32
51 // gdb-command:print u64
53 // gdb-command:print f32
54 // gdb-check:$13 = 2.5
55 // gdb-command:print f64
56 // gdb-check:$14 = 3.5
59 // === LLDB TESTS ==================================================================================
62 // lldb-command:print b
63 // lldbg-check:[...]$0 = false
64 // lldbr-check:(bool) b = false
65 // lldb-command:print i
66 // lldbg-check:[...]$1 = -1
67 // lldbr-check:(isize) i = -1
69 // NOTE: only rust-enabled lldb supports 32bit chars
70 // lldbr-command:print c
71 // lldbr-check:(char) c = 'a'
73 // lldb-command:print i8
74 // lldbg-check:[...]$2 = 'D'
75 // lldbr-check:(i8) i8 = 68
76 // lldb-command:print i16
77 // lldbg-check:[...]$3 = -16
78 // lldbr-check:(i16) i16 = -16
79 // lldb-command:print i32
80 // lldbg-check:[...]$4 = -32
81 // lldbr-check:(i32) i32 = -32
82 // lldb-command:print i64
83 // lldbg-check:[...]$5 = -64
84 // lldbr-check:(i64) i64 = -64
85 // lldb-command:print u
86 // lldbg-check:[...]$6 = 1
87 // lldbr-check:(usize) u = 1
88 // lldb-command:print u8
89 // lldbg-check:[...]$7 = 'd'
90 // lldbr-check:(u8) u8 = 100
91 // lldb-command:print u16
92 // lldbg-check:[...]$8 = 16
93 // lldbr-check:(u16) u16 = 16
94 // lldb-command:print u32
95 // lldbg-check:[...]$9 = 32
96 // lldbr-check:(u32) u32 = 32
97 // lldb-command:print u64
98 // lldbg-check:[...]$10 = 64
99 // lldbr-check:(u64) u64 = 64
100 // lldb-command:print f32
101 // lldbg-check:[...]$11 = 2.5
102 // lldbr-check:(f32) f32 = 2.5
103 // lldb-command:print f64
104 // lldbg-check:[...]$12 = 3.5
105 // lldbr-check:(f64) f64 = 3.5
107 #![allow(unused_variables)]
108 #![feature(omit_gdb_pretty_printer_section)]
109 #![omit_gdb_pretty_printer_section]