2014-02-06 21:57:09 -06:00
|
|
|
//@ compile-flags:-g
|
2014-10-09 09:31:03 -05:00
|
|
|
//@ min-lldb-version: 310
|
2014-07-09 07:46:09 -05:00
|
|
|
|
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:run
|
|
|
|
// gdb-command:print *bool_ref
|
|
|
|
// gdb-check:$1 = true
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *int_ref
|
|
|
|
// gdb-check:$2 = -1
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2022-03-17 21:19:10 -05:00
|
|
|
// gdb-command:print/d *char_ref
|
2021-10-14 12:26:42 -05:00
|
|
|
// gdb-check:$3 = 97
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *i8_ref
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-check:$4 = 68 'D'
|
|
|
|
// gdbr-check:$4 = 68
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *i16_ref
|
|
|
|
// gdb-check:$5 = -16
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *i32_ref
|
|
|
|
// gdb-check:$6 = -32
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *i64_ref
|
|
|
|
// gdb-check:$7 = -64
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *uint_ref
|
|
|
|
// gdb-check:$8 = 1
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *u8_ref
|
2016-10-25 16:32:04 -05:00
|
|
|
// gdbg-check:$9 = 100 'd'
|
|
|
|
// gdbr-check:$9 = 100
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *u16_ref
|
|
|
|
// gdb-check:$10 = 16
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *u32_ref
|
|
|
|
// gdb-check:$11 = 32
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *u64_ref
|
|
|
|
// gdb-check:$12 = 64
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *f32_ref
|
|
|
|
// gdb-check:$13 = 2.5
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *f64_ref
|
|
|
|
// gdb-check:$14 = 3.5
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
|
|
|
|
// === LLDB TESTS ==================================================================================
|
|
|
|
|
|
|
|
// lldb-command:run
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v *bool_ref
|
2024-03-10 08:55:58 -05:00
|
|
|
// lldbg-check:[...] true
|
2018-10-02 11:13:30 -05:00
|
|
|
// lldbr-check:(bool) *bool_ref = true
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v *int_ref
|
2024-03-10 08:55:58 -05:00
|
|
|
// lldbg-check:[...] -1
|
2018-10-02 11:13:30 -05:00
|
|
|
// lldbr-check:(isize) *int_ref = -1
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2018-10-02 11:13:30 -05:00
|
|
|
// NOTE: only rust-enabled lldb supports 32bit chars
|
|
|
|
// lldbr-command:print *char_ref
|
|
|
|
// lldbr-check:(char) *char_ref = 'a'
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v *i8_ref
|
2024-03-10 08:55:58 -05:00
|
|
|
// lldbg-check:[...] 'D'
|
2018-10-02 11:13:30 -05:00
|
|
|
// lldbr-check:(i8) *i8_ref = 68
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v *i16_ref
|
2024-03-10 08:55:58 -05:00
|
|
|
// lldbg-check:[...] -16
|
2018-10-02 11:13:30 -05:00
|
|
|
// lldbr-check:(i16) *i16_ref = -16
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v *i32_ref
|
2024-03-10 08:55:58 -05:00
|
|
|
// lldbg-check:[...] -32
|
2018-10-02 11:13:30 -05:00
|
|
|
// lldbr-check:(i32) *i32_ref = -32
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v *i64_ref
|
2024-03-10 08:55:58 -05:00
|
|
|
// lldbg-check:[...] -64
|
2018-10-02 11:13:30 -05:00
|
|
|
// lldbr-check:(i64) *i64_ref = -64
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v *uint_ref
|
2024-03-10 08:55:58 -05:00
|
|
|
// lldbg-check:[...] 1
|
2018-10-02 11:13:30 -05:00
|
|
|
// lldbr-check:(usize) *uint_ref = 1
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v *u8_ref
|
2024-03-10 08:55:58 -05:00
|
|
|
// lldbg-check:[...] 'd'
|
2018-10-02 11:13:30 -05:00
|
|
|
// lldbr-check:(u8) *u8_ref = 100
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v *u16_ref
|
2024-03-10 08:55:58 -05:00
|
|
|
// lldbg-check:[...] 16
|
2018-10-02 11:13:30 -05:00
|
|
|
// lldbr-check:(u16) *u16_ref = 16
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v *u32_ref
|
2024-03-10 08:55:58 -05:00
|
|
|
// lldbg-check:[...] 32
|
2018-10-02 11:13:30 -05:00
|
|
|
// lldbr-check:(u32) *u32_ref = 32
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v *u64_ref
|
2024-03-10 08:55:58 -05:00
|
|
|
// lldbg-check:[...] 64
|
2018-10-02 11:13:30 -05:00
|
|
|
// lldbr-check:(u64) *u64_ref = 64
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v *f32_ref
|
2024-03-10 08:55:58 -05:00
|
|
|
// lldbg-check:[...] 2.5
|
2018-10-02 11:13:30 -05:00
|
|
|
// lldbr-check:(f32) *f32_ref = 2.5
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v *f64_ref
|
2024-03-10 08:55:58 -05:00
|
|
|
// lldbg-check:[...] 3.5
|
2018-10-02 11:13:30 -05:00
|
|
|
// lldbr-check:(f64) *f64_ref = 3.5
|
2014-07-09 07:46:09 -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]
|
2013-08-17 10:37:42 -05:00
|
|
|
|
2013-06-24 10:18:10 -05:00
|
|
|
fn main() {
|
|
|
|
let bool_val: bool = true;
|
2013-07-16 05:17:55 -05:00
|
|
|
let bool_ref: &bool = &bool_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
let int_val: isize = -1;
|
|
|
|
let int_ref: &isize = &int_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let char_val: char = 'a';
|
2013-07-16 05:17:55 -05:00
|
|
|
let char_ref: &char = &char_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let i8_val: i8 = 68;
|
2013-07-16 05:17:55 -05:00
|
|
|
let i8_ref: &i8 = &i8_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let i16_val: i16 = -16;
|
2013-07-16 05:17:55 -05:00
|
|
|
let i16_ref: &i16 = &i16_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let i32_val: i32 = -32;
|
2013-07-16 05:17:55 -05:00
|
|
|
let i32_ref: &i32 = &i32_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
debuginfo: Make sure that all calls to drop glue are associated with debug locations.
This commit makes rustc emit debug locations for all call
and invoke statements in LLVM IR, if they are contained
within a function that debuginfo is enabled for. This is
important because LLVM does not handle the case where a
function body containing debuginfo is inlined into another
function with debuginfo, but the inlined call statement
does not have a debug location. In this case, LLVM will
not know where (in terms of source code coordinates) the
function was inlined to and we end up with some statements
still linked to the source locations in there original,
non-inlined function without any indication that they are
indeed an inline-copy. Later, when generating DWARF from
the IR, LLVM will interpret this as corrupt IR and abort.
Unfortunately, the undesirable case described above can
still occur when using LTO. If there is a crate compiled
without debuginfo calling into a crate compiled with
debuginfo, we again end up with the conditions triggering
the error. This is why some LTO tests still fail with the
dreaded assertion, if the standard library was built with
debuginfo enabled.
That is, `RUSTFLAGS_STAGE2=-g make rustc-stage2` will
succeed but `RUSTFLAGS_STAGE2=-g make check` will still
fail after this commit has been merged. This is a problem
that has to be dealt with separately.
Fixes #17201
Fixes #15816
Fixes #15156
2014-09-24 01:49:38 -05:00
|
|
|
let i64_val: i64 = -64;
|
|
|
|
let i64_ref: &i64 = &i64_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
let uint_val: usize = 1;
|
|
|
|
let uint_ref: &usize = &uint_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let u8_val: u8 = 100;
|
2013-07-16 05:17:55 -05:00
|
|
|
let u8_ref: &u8 = &u8_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let u16_val: u16 = 16;
|
2013-07-16 05:17:55 -05:00
|
|
|
let u16_ref: &u16 = &u16_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let u32_val: u32 = 32;
|
2013-07-16 05:17:55 -05:00
|
|
|
let u32_ref: &u32 = &u32_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let u64_val: u64 = 64;
|
2013-07-16 05:17:55 -05:00
|
|
|
let u64_ref: &u64 = &u64_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let f32_val: f32 = 2.5;
|
2013-07-16 05:17:55 -05:00
|
|
|
let f32_ref: &f32 = &f32_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let f64_val: f64 = 3.5;
|
2013-07-16 05:17:55 -05:00
|
|
|
let f64_ref: &f64 = &f64_val;
|
2014-07-09 07:46:09 -05:00
|
|
|
|
|
|
|
zzz(); // #break
|
2013-06-24 10:18:10 -05:00
|
|
|
}
|
|
|
|
|
2013-08-17 10:37:42 -05:00
|
|
|
fn zzz() {()}
|