]> git.lizzy.rs Git - rust.git/blob - src/test/debug-info/borrowed-unique-basic.rs
auto merge of #13967 : richo/rust/features/ICE-fails, r=alexcrichton
[rust.git] / src / test / debug-info / 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 // ignore-android: FIXME(#10381)
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 // debugger:rbreak zzz
18 // debugger:run
19 // debugger:finish
20 // debugger:print *bool_ref
21 // check:$1 = true
22
23 // debugger:print *int_ref
24 // check:$2 = -1
25
26 // debugger:print *char_ref
27 // check:$3 = 97
28
29 // debugger:print/d *i8_ref
30 // check:$4 = 68
31
32 // debugger:print *i16_ref
33 // check:$5 = -16
34
35 // debugger:print *i32_ref
36 // check:$6 = -32
37
38 // debugger:print *i64_ref
39 // check:$7 = -64
40
41 // debugger:print *uint_ref
42 // check:$8 = 1
43
44 // debugger:print/d *u8_ref
45 // check:$9 = 100
46
47 // debugger:print *u16_ref
48 // check:$10 = 16
49
50 // debugger:print *u32_ref
51 // check:$11 = 32
52
53 // debugger:print *u64_ref
54 // check:$12 = 64
55
56 // debugger:print *f32_ref
57 // check:$13 = 2.5
58
59 // debugger:print *f64_ref
60 // check:$14 = 3.5
61
62 #![allow(unused_variable)]
63
64
65 fn main() {
66     let bool_box: Box<bool> = box true;
67     let bool_ref: &bool = bool_box;
68
69     let int_box: Box<int> = box -1;
70     let int_ref: &int = int_box;
71
72     let char_box: Box<char> = box 'a';
73     let char_ref: &char = char_box;
74
75     let i8_box: Box<i8> = box 68;
76     let i8_ref: &i8 = i8_box;
77
78     let i16_box: Box<i16> = box -16;
79     let i16_ref: &i16 = i16_box;
80
81     let i32_box: Box<i32> = box -32;
82     let i32_ref: &i32 = i32_box;
83
84     let i64_box: Box<i64> = box -64;
85     let i64_ref: &i64 = i64_box;
86
87     let uint_box: Box<uint> = box 1;
88     let uint_ref: &uint = uint_box;
89
90     let u8_box: Box<u8> = box 100;
91     let u8_ref: &u8 = u8_box;
92
93     let u16_box: Box<u16> = box 16;
94     let u16_ref: &u16 = u16_box;
95
96     let u32_box: Box<u32> = box 32;
97     let u32_ref: &u32 = u32_box;
98
99     let u64_box: Box<u64> = box 64;
100     let u64_ref: &u64 = u64_box;
101
102     let f32_box: Box<f32> = box 2.5;
103     let f32_ref: &f32 = f32_box;
104
105     let f64_box: Box<f64> = box 3.5;
106     let f64_ref: &f64 = f64_box;
107     zzz();
108 }
109
110 fn zzz() {()}