]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/basic-types-mut-globals.rs
Merge pull request #37635 from brson/bootstrap
[rust.git] / src / test / debuginfo / basic-types-mut-globals.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 // 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.
16
17 // min-lldb-version: 310
18
19 // compile-flags:-g
20
21 // gdb-command:run
22
23 // Check initializers
24 // gdbg-command:print 'basic_types_mut_globals::B'
25 // gdbr-command:print B
26 // gdb-check:$1 = false
27 // gdbg-command:print 'basic_types_mut_globals::I'
28 // gdbr-command:print I
29 // gdb-check:$2 = -1
30 // gdbg-command:print/d 'basic_types_mut_globals::C'
31 // gdbr-command:print C
32 // gdbg-check:$3 = 97
33 // gdbr-check:$3 = 97 'a'
34 // gdbg-command:print/d 'basic_types_mut_globals::I8'
35 // gdbr-command:print I8
36 // gdb-check:$4 = 68
37 // gdbg-command:print 'basic_types_mut_globals::I16'
38 // gdbr-command:print I16
39 // gdb-check:$5 = -16
40 // gdbg-command:print 'basic_types_mut_globals::I32'
41 // gdbr-command:print I32
42 // gdb-check:$6 = -32
43 // gdbg-command:print 'basic_types_mut_globals::I64'
44 // gdbr-command:print I64
45 // gdb-check:$7 = -64
46 // gdbg-command:print 'basic_types_mut_globals::U'
47 // gdbr-command:print U
48 // gdb-check:$8 = 1
49 // gdbg-command:print/d 'basic_types_mut_globals::U8'
50 // gdbr-command:print U8
51 // gdb-check:$9 = 100
52 // gdbg-command:print 'basic_types_mut_globals::U16'
53 // gdbr-command:print U16
54 // gdb-check:$10 = 16
55 // gdbg-command:print 'basic_types_mut_globals::U32'
56 // gdbr-command:print U32
57 // gdb-check:$11 = 32
58 // gdbg-command:print 'basic_types_mut_globals::U64'
59 // gdbr-command:print U64
60 // gdb-check:$12 = 64
61 // gdbg-command:print 'basic_types_mut_globals::F32'
62 // gdbr-command:print F32
63 // gdb-check:$13 = 2.5
64 // gdbg-command:print 'basic_types_mut_globals::F64'
65 // gdbr-command:print F64
66 // gdb-check:$14 = 3.5
67 // gdb-command:continue
68
69 // Check new values
70 // gdbg-command:print 'basic_types_mut_globals'::B
71 // gdbr-command:print B
72 // gdb-check:$15 = true
73 // gdbg-command:print 'basic_types_mut_globals'::I
74 // gdbr-command:print I
75 // gdb-check:$16 = 2
76 // gdbg-command:print/d 'basic_types_mut_globals'::C
77 // gdbr-command:print C
78 // gdbg-check:$17 = 102
79 // gdbr-check:$17 = 102 'f'
80 // gdbg-command:print/d 'basic_types_mut_globals'::I8
81 // gdbr-command:print/d I8
82 // gdb-check:$18 = 78
83 // gdbg-command:print 'basic_types_mut_globals'::I16
84 // gdbr-command:print I16
85 // gdb-check:$19 = -26
86 // gdbg-command:print 'basic_types_mut_globals'::I32
87 // gdbr-command:print I32
88 // gdb-check:$20 = -12
89 // gdbg-command:print 'basic_types_mut_globals'::I64
90 // gdbr-command:print I64
91 // gdb-check:$21 = -54
92 // gdbg-command:print 'basic_types_mut_globals'::U
93 // gdbr-command:print U
94 // gdb-check:$22 = 5
95 // gdbg-command:print/d 'basic_types_mut_globals'::U8
96 // gdbr-command:print/d U8
97 // gdb-check:$23 = 20
98 // gdbg-command:print 'basic_types_mut_globals'::U16
99 // gdbr-command:print U16
100 // gdb-check:$24 = 32
101 // gdbg-command:print 'basic_types_mut_globals'::U32
102 // gdbr-command:print U32
103 // gdb-check:$25 = 16
104 // gdbg-command:print 'basic_types_mut_globals'::U64
105 // gdbr-command:print U64
106 // gdb-check:$26 = 128
107 // gdbg-command:print 'basic_types_mut_globals'::F32
108 // gdbr-command:print F32
109 // gdb-check:$27 = 5.75
110 // gdbg-command:print 'basic_types_mut_globals'::F64
111 // gdbr-command:print F64
112 // gdb-check:$28 = 9.25
113
114 #![allow(unused_variables)]
115 #![feature(omit_gdb_pretty_printer_section)]
116 #![omit_gdb_pretty_printer_section]
117
118 static mut B: bool = false;
119 static mut I: isize = -1;
120 static mut C: char = 'a';
121 static mut I8: i8 = 68;
122 static mut I16: i16 = -16;
123 static mut I32: i32 = -32;
124 static mut I64: i64 = -64;
125 static mut U: usize = 1;
126 static mut U8: u8 = 100;
127 static mut U16: u16 = 16;
128 static mut U32: u32 = 32;
129 static mut U64: u64 = 64;
130 static mut F32: f32 = 2.5;
131 static mut F64: f64 = 3.5;
132
133 fn main() {
134     _zzz(); // #break
135
136     unsafe {
137         B = true;
138         I = 2;
139         C = 'f';
140         I8 = 78;
141         I16 = -26;
142         I32 = -12;
143         I64 = -54;
144         U = 5;
145         U8 = 20;
146         U16 = 32;
147         U32 = 16;
148         U64 = 128;
149         F32 = 5.75;
150         F64 = 9.25;
151     }
152
153     _zzz(); // #break
154 }
155
156 fn _zzz() {()}