2014-04-24 04:35:48 -05:00
|
|
|
// Caveats - gdb prints any 8-bit value (meaning rust I8 and u8 values)
|
|
|
|
// as its numerical value along with its associated ASCII char, there
|
|
|
|
// doesn't seem to be any way around this. Also, gdb doesn't know
|
|
|
|
// about UTF-32 character encoding and will print a rust char as only
|
|
|
|
// its numerical value.
|
|
|
|
|
2014-10-09 09:31:03 -05:00
|
|
|
//@ min-lldb-version: 310
|
2014-04-24 04:35:48 -05:00
|
|
|
|
|
|
|
//@ compile-flags:-g
|
2014-10-29 01:13:29 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:run
|
|
|
|
|
|
|
|
// Check initializers
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals::B'
|
|
|
|
// gdbr-command:print B
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-check:$1 = false
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals::I'
|
|
|
|
// gdbr-command:print I
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-check:$2 = -1
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print/d 'basic_types_mut_globals::C'
|
|
|
|
// gdbr-command:print C
|
|
|
|
// gdbg-check:$3 = 97
|
|
|
|
// gdbr-check:$3 = 97 'a'
|
|
|
|
// gdbg-command:print/d 'basic_types_mut_globals::I8'
|
|
|
|
// gdbr-command:print I8
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-check:$4 = 68
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals::I16'
|
|
|
|
// gdbr-command:print I16
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-check:$5 = -16
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals::I32'
|
|
|
|
// gdbr-command:print I32
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-check:$6 = -32
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals::I64'
|
|
|
|
// gdbr-command:print I64
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-check:$7 = -64
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals::U'
|
|
|
|
// gdbr-command:print U
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-check:$8 = 1
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print/d 'basic_types_mut_globals::U8'
|
|
|
|
// gdbr-command:print U8
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-check:$9 = 100
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals::U16'
|
|
|
|
// gdbr-command:print U16
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-check:$10 = 16
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals::U32'
|
|
|
|
// gdbr-command:print U32
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-check:$11 = 32
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals::U64'
|
|
|
|
// gdbr-command:print U64
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-check:$12 = 64
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals::F16'
|
|
|
|
// gdbr-command:print F16
|
|
|
|
// gdb-check:$13 = 1.5
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals::F32'
|
|
|
|
// gdbr-command:print F32
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$14 = 2.5
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals::F64'
|
|
|
|
// gdbr-command:print F64
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$15 = 3.5
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// Check new values
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals'::B
|
|
|
|
// gdbr-command:print B
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$16 = true
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals'::I
|
|
|
|
// gdbr-command:print I
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$17 = 2
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print/d 'basic_types_mut_globals'::C
|
|
|
|
// gdbr-command:print C
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdbg-check:$18 = 102
|
|
|
|
// gdbr-check:$18 = 102 'f'
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print/d 'basic_types_mut_globals'::I8
|
|
|
|
// gdbr-command:print/d I8
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$19 = 78
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals'::I16
|
|
|
|
// gdbr-command:print I16
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$20 = -26
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals'::I32
|
|
|
|
// gdbr-command:print I32
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$21 = -12
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals'::I64
|
|
|
|
// gdbr-command:print I64
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$22 = -54
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals'::U
|
|
|
|
// gdbr-command:print U
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$23 = 5
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print/d 'basic_types_mut_globals'::U8
|
|
|
|
// gdbr-command:print/d U8
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$24 = 20
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals'::U16
|
|
|
|
// gdbr-command:print U16
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$25 = 32
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals'::U32
|
|
|
|
// gdbr-command:print U32
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$26 = 16
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals'::U64
|
|
|
|
// gdbr-command:print U64
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$27 = 128
|
|
|
|
// gdbg-command:print 'basic_types_mut_globals'::F16
|
|
|
|
// gdbr-command:print F16
|
|
|
|
// gdb-check:$28 = 2.25
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals'::F32
|
|
|
|
// gdbr-command:print F32
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$29 = 5.75
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-command:print 'basic_types_mut_globals'::F64
|
|
|
|
// gdbr-command:print F64
|
2024-06-26 12:18:32 -05:00
|
|
|
// gdb-check:$30 = 9.25
|
2014-04-24 04:35:48 -05:00
|
|
|
|
2014-10-27 17:37:07 -05:00
|
|
|
#![allow(unused_variables)]
|
2015-09-19 15:33:47 -05:00
|
|
|
#![feature(omit_gdb_pretty_printer_section)]
|
2014-12-03 16:48:18 -06:00
|
|
|
#![omit_gdb_pretty_printer_section]
|
2024-06-26 12:18:32 -05:00
|
|
|
#![feature(f16)]
|
2014-04-24 04:35:48 -05:00
|
|
|
|
|
|
|
static mut B: bool = false;
|
2015-03-25 19:06:52 -05:00
|
|
|
static mut I: isize = -1;
|
2014-04-24 04:35:48 -05:00
|
|
|
static mut C: char = 'a';
|
|
|
|
static mut I8: i8 = 68;
|
|
|
|
static mut I16: i16 = -16;
|
|
|
|
static mut I32: i32 = -32;
|
|
|
|
static mut I64: i64 = -64;
|
2015-03-25 19:06:52 -05:00
|
|
|
static mut U: usize = 1;
|
2014-04-24 04:35:48 -05:00
|
|
|
static mut U8: u8 = 100;
|
|
|
|
static mut U16: u16 = 16;
|
|
|
|
static mut U32: u32 = 32;
|
|
|
|
static mut U64: u64 = 64;
|
2024-06-26 12:18:32 -05:00
|
|
|
static mut F16: f16 = 1.5;
|
2014-04-24 04:35:48 -05:00
|
|
|
static mut F32: f32 = 2.5;
|
|
|
|
static mut F64: f64 = 3.5;
|
|
|
|
|
|
|
|
fn main() {
|
2014-10-29 01:13:29 -05:00
|
|
|
_zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
|
|
|
|
unsafe {
|
|
|
|
B = true;
|
|
|
|
I = 2;
|
|
|
|
C = 'f';
|
|
|
|
I8 = 78;
|
|
|
|
I16 = -26;
|
|
|
|
I32 = -12;
|
|
|
|
I64 = -54;
|
|
|
|
U = 5;
|
|
|
|
U8 = 20;
|
|
|
|
U16 = 32;
|
|
|
|
U32 = 16;
|
|
|
|
U64 = 128;
|
2024-06-26 12:18:32 -05:00
|
|
|
F16 = 2.25;
|
2014-04-24 04:35:48 -05:00
|
|
|
F32 = 5.75;
|
|
|
|
F64 = 9.25;
|
|
|
|
}
|
|
|
|
|
2014-10-29 01:13:29 -05:00
|
|
|
_zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn _zzz() {()}
|