]> git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/borrowed-unique-basic.rs
Merge tag 'upstream-tar/1.0.0-alpha.2'
[rustc.git] / src / test / debuginfo / borrowed-unique-basic.rs
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.
4 //
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.
10
11 // min-lldb-version: 310
12
13 // Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
14 // its numerical value.
15
16 // compile-flags:-g
17
18 // === GDB TESTS ===================================================================================
19
20 // gdb-command:run
21
22 // gdb-command:print *bool_ref
23 // gdb-check:$1 = true
24
25 // gdb-command:print *int_ref
26 // gdb-check:$2 = -1
27
28 // gdb-command:print *char_ref
29 // gdb-check:$3 = 97
30
31 // gdb-command:print/d *i8_ref
32 // gdb-check:$4 = 68
33
34 // gdb-command:print *i16_ref
35 // gdb-check:$5 = -16
36
37 // gdb-command:print *i32_ref
38 // gdb-check:$6 = -32
39
40 // gdb-command:print *i64_ref
41 // gdb-check:$7 = -64
42
43 // gdb-command:print *uint_ref
44 // gdb-check:$8 = 1
45
46 // gdb-command:print/d *u8_ref
47 // gdb-check:$9 = 100
48
49 // gdb-command:print *u16_ref
50 // gdb-check:$10 = 16
51
52 // gdb-command:print *u32_ref
53 // gdb-check:$11 = 32
54
55 // gdb-command:print *u64_ref
56 // gdb-check:$12 = 64
57
58 // gdb-command:print *f32_ref
59 // gdb-check:$13 = 2.5
60
61 // gdb-command:print *f64_ref
62 // gdb-check:$14 = 3.5
63
64
65 // === LLDB TESTS ==================================================================================
66
67 // lldb-command:type format add -f decimal char
68 // lldb-command:type format add -f decimal 'unsigned char'
69 // lldb-command:run
70
71 // lldb-command:print *bool_ref
72 // lldb-check:[...]$0 = true
73
74 // lldb-command:print *int_ref
75 // lldb-check:[...]$1 = -1
76
77 // d ebugger:print *char_ref
78 // c heck:[...]$3 = 97
79
80 // lldb-command:print *i8_ref
81 // lldb-check:[...]$2 = 68
82
83 // lldb-command:print *i16_ref
84 // lldb-check:[...]$3 = -16
85
86 // lldb-command:print *i32_ref
87 // lldb-check:[...]$4 = -32
88
89 // lldb-command:print *i64_ref
90 // lldb-check:[...]$5 = -64
91
92 // lldb-command:print *uint_ref
93 // lldb-check:[...]$6 = 1
94
95 // lldb-command:print *u8_ref
96 // lldb-check:[...]$7 = 100
97
98 // lldb-command:print *u16_ref
99 // lldb-check:[...]$8 = 16
100
101 // lldb-command:print *u32_ref
102 // lldb-check:[...]$9 = 32
103
104 // lldb-command:print *u64_ref
105 // lldb-check:[...]$10 = 64
106
107 // lldb-command:print *f32_ref
108 // lldb-check:[...]$11 = 2.5
109
110 // lldb-command:print *f64_ref
111 // lldb-check:[...]$12 = 3.5
112
113 #![allow(unused_variables)]
114 #![feature(box_syntax)]
115 #![omit_gdb_pretty_printer_section]
116
117 fn main() {
118 let bool_box: Box<bool> = box true;
119 let bool_ref: &bool = &*bool_box;
120
121 let int_box: Box<int> = box -1;
122 let int_ref: &int = &*int_box;
123
124 let char_box: Box<char> = box 'a';
125 let char_ref: &char = &*char_box;
126
127 let i8_box: Box<i8> = box 68;
128 let i8_ref: &i8 = &*i8_box;
129
130 let i16_box: Box<i16> = box -16;
131 let i16_ref: &i16 = &*i16_box;
132
133 let i32_box: Box<i32> = box -32;
134 let i32_ref: &i32 = &*i32_box;
135
136 let i64_box: Box<i64> = box -64;
137 let i64_ref: &i64 = &*i64_box;
138
139 let uint_box: Box<uint> = box 1;
140 let uint_ref: &uint = &*uint_box;
141
142 let u8_box: Box<u8> = box 100;
143 let u8_ref: &u8 = &*u8_box;
144
145 let u16_box: Box<u16> = box 16;
146 let u16_ref: &u16 = &*u16_box;
147
148 let u32_box: Box<u32> = box 32;
149 let u32_ref: &u32 = &*u32_box;
150
151 let u64_box: Box<u64> = box 64;
152 let u64_ref: &u64 = &*u64_box;
153
154 let f32_box: Box<f32> = box 2.5;
155 let f32_ref: &f32 = &*f32_box;
156
157 let f64_box: Box<f64> = box 3.5;
158 let f64_ref: &f64 = &*f64_box;
159
160 zzz(); // #break
161 }
162
163 fn zzz() {()}