2014-10-09 14:31:03 +00:00
|
|
|
//@ min-lldb-version: 310
|
2013-12-13 23:45:08 +00:00
|
|
|
|
2014-02-07 03:57:09 +00:00
|
|
|
//@ compile-flags:-g
|
2014-07-09 12:46:09 +00:00
|
|
|
|
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:run
|
2014-10-29 06:13:29 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print *bool_ref
|
|
|
|
// gdb-check:$1 = true
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print *int_ref
|
|
|
|
// gdb-check:$2 = -1
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2022-03-18 02:19:10 +00:00
|
|
|
// gdb-command:print/d *char_ref
|
2021-10-14 17:26:42 +00:00
|
|
|
// gdb-check:$3 = 97
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print/d *i8_ref
|
|
|
|
// gdb-check:$4 = 68
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print *i16_ref
|
|
|
|
// gdb-check:$5 = -16
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print *i32_ref
|
|
|
|
// gdb-check:$6 = -32
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print *i64_ref
|
|
|
|
// gdb-check:$7 = -64
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print *uint_ref
|
|
|
|
// gdb-check:$8 = 1
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print/d *u8_ref
|
|
|
|
// gdb-check:$9 = 100
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print *u16_ref
|
|
|
|
// gdb-check:$10 = 16
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print *u32_ref
|
|
|
|
// gdb-check:$11 = 32
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print *u64_ref
|
|
|
|
// gdb-check:$12 = 64
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print *f32_ref
|
|
|
|
// gdb-check:$13 = 2.5
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print *f64_ref
|
|
|
|
// gdb-check:$14 = 3.5
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2014-07-09 12:46:09 +00:00
|
|
|
|
|
|
|
// === LLDB TESTS ==================================================================================
|
|
|
|
|
|
|
|
// lldb-command:type format add -f decimal char
|
|
|
|
// lldb-command:type format add -f decimal 'unsigned char'
|
|
|
|
// lldb-command:run
|
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *bool_ref
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] true
|
2018-10-02 16:13:30 +00:00
|
|
|
// lldbr-check:(bool) *bool_ref = true
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *int_ref
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] -1
|
2018-10-02 16:13:30 +00:00
|
|
|
// lldbr-check:(isize) *int_ref = -1
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2018-10-02 16:13:30 +00:00
|
|
|
// NOTE: only rust-enabled lldb supports 32bit chars
|
|
|
|
// lldbr-command:print *char_ref
|
|
|
|
// lldbr-check:(char) *char_ref = 97
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *i8_ref
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] 68
|
2018-10-02 16:13:30 +00:00
|
|
|
// lldbr-check:(i8) *i8_ref = 68
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *i16_ref
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] -16
|
2018-10-02 16:13:30 +00:00
|
|
|
// lldbr-check:(i16) *i16_ref = -16
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *i32_ref
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] -32
|
2018-10-02 16:13:30 +00:00
|
|
|
// lldbr-check:(i32) *i32_ref = -32
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *i64_ref
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] -64
|
2018-10-02 16:13:30 +00:00
|
|
|
// lldbr-check:(i64) *i64_ref = -64
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *uint_ref
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] 1
|
2018-10-02 16:13:30 +00:00
|
|
|
// lldbr-check:(usize) *uint_ref = 1
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *u8_ref
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] 100
|
2018-10-02 16:13:30 +00:00
|
|
|
// lldbr-check:(u8) *u8_ref = 100
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *u16_ref
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] 16
|
2018-10-02 16:13:30 +00:00
|
|
|
// lldbr-check:(u16) *u16_ref = 16
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *u32_ref
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] 32
|
2018-10-02 16:13:30 +00:00
|
|
|
// lldbr-check:(u32) *u32_ref = 32
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *u64_ref
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] 64
|
2018-10-02 16:13:30 +00:00
|
|
|
// lldbr-check:(u64) *u64_ref = 64
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *f32_ref
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] 2.5
|
2018-10-02 16:13:30 +00:00
|
|
|
// lldbr-check:(f32) *f32_ref = 2.5
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *f64_ref
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] 3.5
|
2018-10-02 16:13:30 +00:00
|
|
|
// lldbr-check:(f64) *f64_ref = 3.5
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2014-10-27 22:37:07 +00:00
|
|
|
#![allow(unused_variables)]
|
2015-09-19 20:33:47 +00:00
|
|
|
#![feature(omit_gdb_pretty_printer_section)]
|
2014-12-03 22:48:18 +00:00
|
|
|
#![omit_gdb_pretty_printer_section]
|
2013-06-24 15:47:21 +00:00
|
|
|
|
|
|
|
fn main() {
|
2021-08-25 00:39:40 +00:00
|
|
|
let bool_box: Box<bool> = Box::new(true);
|
2014-07-07 23:35:15 +00:00
|
|
|
let bool_ref: &bool = &*bool_box;
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
let int_box: Box<isize> = Box::new(-1);
|
2015-03-26 00:06:52 +00:00
|
|
|
let int_ref: &isize = &*int_box;
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
let char_box: Box<char> = Box::new('a');
|
2014-07-07 23:35:15 +00:00
|
|
|
let char_ref: &char = &*char_box;
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
let i8_box: Box<i8> = Box::new(68);
|
2014-07-07 23:35:15 +00:00
|
|
|
let i8_ref: &i8 = &*i8_box;
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
let i16_box: Box<i16> = Box::new(-16);
|
2014-07-07 23:35:15 +00:00
|
|
|
let i16_ref: &i16 = &*i16_box;
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
let i32_box: Box<i32> = Box::new(-32);
|
2014-07-07 23:35:15 +00:00
|
|
|
let i32_ref: &i32 = &*i32_box;
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
let i64_box: Box<i64> = Box::new(-64);
|
2014-07-07 23:35:15 +00:00
|
|
|
let i64_ref: &i64 = &*i64_box;
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
let uint_box: Box<usize> = Box::new(1);
|
2015-03-26 00:06:52 +00:00
|
|
|
let uint_ref: &usize = &*uint_box;
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
let u8_box: Box<u8> = Box::new(100);
|
2014-07-07 23:35:15 +00:00
|
|
|
let u8_ref: &u8 = &*u8_box;
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
let u16_box: Box<u16> = Box::new(16);
|
2014-07-07 23:35:15 +00:00
|
|
|
let u16_ref: &u16 = &*u16_box;
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
let u32_box: Box<u32> = Box::new(32);
|
2014-07-07 23:35:15 +00:00
|
|
|
let u32_ref: &u32 = &*u32_box;
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
let u64_box: Box<u64> = Box::new(64);
|
2014-07-07 23:35:15 +00:00
|
|
|
let u64_ref: &u64 = &*u64_box;
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
let f32_box: Box<f32> = Box::new(2.5);
|
2014-07-07 23:35:15 +00:00
|
|
|
let f32_ref: &f32 = &*f32_box;
|
2013-06-24 15:47:21 +00:00
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
let f64_box: Box<f64> = Box::new(3.5);
|
2014-07-07 23:35:15 +00:00
|
|
|
let f64_ref: &f64 = &*f64_box;
|
2014-07-09 12:46:09 +00:00
|
|
|
|
|
|
|
zzz(); // #break
|
2013-06-24 15:47:21 +00:00
|
|
|
}
|
|
|
|
|
2013-08-17 15:37:42 +00:00
|
|
|
fn zzz() {()}
|