blob: f9ce1728930ed6b5fab639f213e2f1534bad1c6c [file] [log] [blame]
Michael Woeristerfb3e17b2013-06-24 15:47:211// Copyright 2013 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// xfail-win32 Broken because of LLVM bug: http://llvm.org/bugs/show_bug.cgi?id=16249
12
Michael Woerister7a31a3e2013-06-28 07:35:2113// Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
Michael Woeristerfb3e17b2013-06-24 15:47:2114// its numerical value.
15
16// compile-flags:-Z extra-debug-info
17// debugger:break 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 *float_ref
57// check:$13 = 1.5
58
59// debugger:print *f32_ref
60// check:$14 = 2.5
61
62// debugger:print *f64_ref
63// check:$15 = 3.5
64
65
66fn main() {
67 let bool_box: ~bool = ~true;
68 let bool_ref : &bool = bool_box;
69
70 let int_box: ~int = ~-1;
71 let int_ref : &int = int_box;
72
73 let char_box: ~char = ~'a';
74 let char_ref : &char = char_box;
75
76 let i8_box: ~i8 = ~68;
77 let i8_ref : &i8 = i8_box;
78
79 let i16_box: ~i16 = ~-16;
80 let i16_ref : &i16 = i16_box;
81
82 let i32_box: ~i32 = ~-32;
83 let i32_ref : &i32 = i32_box;
84
85 let i64_box: ~i64 = ~-64;
86 let i64_ref : &i64 = i64_box;
87
88 let uint_box: ~uint = ~1;
89 let uint_ref : &uint = uint_box;
90
91 let u8_box: ~u8 = ~100;
92 let u8_ref : &u8 = u8_box;
93
94 let u16_box: ~u16 = ~16;
95 let u16_ref : &u16 = u16_box;
96
97 let u32_box: ~u32 = ~32;
98 let u32_ref : &u32 = u32_box;
99
100 let u64_box: ~u64 = ~64;
101 let u64_ref : &u64 = u64_box;
102
103 let float_box: ~float = ~1.5;
104 let float_ref : &float = float_box;
105
106 let f32_box: ~f32 = ~2.5;
107 let f32_ref : &f32 = f32_box;
108
109 let f64_box: ~f64 = ~3.5;
110 let f64_ref : &f64 = f64_box;
111 zzz();
112}
113
114fn zzz() {()}