diff options
Diffstat (limited to 'tests/debuginfo')
-rw-r--r-- | tests/debuginfo/associated-types.rs | 2 | ||||
-rw-r--r-- | tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.rs | 1 | ||||
-rw-r--r-- | tests/debuginfo/auxiliary/macro-stepping.rs | 2 | ||||
-rw-r--r-- | tests/debuginfo/borrowed-enum.rs | 2 | ||||
-rw-r--r-- | tests/debuginfo/embedded-visualizer.rs | 1 | ||||
-rw-r--r-- | tests/debuginfo/generic-method-on-generic-struct.rs | 2 | ||||
-rw-r--r-- | tests/debuginfo/generic-struct.rs | 2 | ||||
-rw-r--r-- | tests/debuginfo/generic-tuple-style-enum.rs | 2 | ||||
-rw-r--r-- | tests/debuginfo/macro-stepping.rs | 20 | ||||
-rw-r--r-- | tests/debuginfo/method-on-generic-struct.rs | 2 | ||||
-rw-r--r-- | tests/debuginfo/pretty-std.rs | 4 | ||||
-rw-r--r-- | tests/debuginfo/reference-debuginfo.rs | 173 | ||||
-rw-r--r-- | tests/debuginfo/struct-style-enum.rs | 2 | ||||
-rw-r--r-- | tests/debuginfo/thread.rs | 2 | ||||
-rw-r--r-- | tests/debuginfo/tuple-style-enum.rs | 2 | ||||
-rw-r--r-- | tests/debuginfo/unique-enum.rs | 2 | ||||
-rw-r--r-- | tests/debuginfo/unsized.rs | 2 |
17 files changed, 202 insertions, 21 deletions
diff --git a/tests/debuginfo/associated-types.rs b/tests/debuginfo/associated-types.rs index 0a0ce3c67..a1735520b 100644 --- a/tests/debuginfo/associated-types.rs +++ b/tests/debuginfo/associated-types.rs @@ -1,6 +1,6 @@ // Some versions of the non-rust-enabled LLDB print the wrong generic // parameter type names in this test. -// rust-lldb +// needs-rust-lldb // compile-flags:-g diff --git a/tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.rs b/tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.rs index 327515b10..c187df637 100644 --- a/tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.rs +++ b/tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.rs @@ -2,7 +2,6 @@ // ignore-lldb // no-prefer-dynamic -#![feature(debugger_visualizer)] #![debugger_visualizer(natvis_file = "dependency-with-embedded-visualizers.natvis")] #![debugger_visualizer(gdb_script_file = "dependency-with-embedded-visualizers.py")] #![crate_type = "rlib"] diff --git a/tests/debuginfo/auxiliary/macro-stepping.rs b/tests/debuginfo/auxiliary/macro-stepping.rs index 4447dd22d..ae50e1144 100644 --- a/tests/debuginfo/auxiliary/macro-stepping.rs +++ b/tests/debuginfo/auxiliary/macro-stepping.rs @@ -5,6 +5,6 @@ #[macro_export] macro_rules! new_scope { () => { - let x = 1; + let x = 1; opaque(x); } } diff --git a/tests/debuginfo/borrowed-enum.rs b/tests/debuginfo/borrowed-enum.rs index f3e465dc6..37d458cb4 100644 --- a/tests/debuginfo/borrowed-enum.rs +++ b/tests/debuginfo/borrowed-enum.rs @@ -1,6 +1,6 @@ // Require a gdb or lldb that can read DW_TAG_variant_part. // min-gdb-version: 8.2 -// rust-lldb +// needs-rust-lldb // compile-flags:-g diff --git a/tests/debuginfo/embedded-visualizer.rs b/tests/debuginfo/embedded-visualizer.rs index 2898e75e0..ac4210928 100644 --- a/tests/debuginfo/embedded-visualizer.rs +++ b/tests/debuginfo/embedded-visualizer.rs @@ -60,7 +60,6 @@ // gdb-check:$4 = "Person A" is 10 years old. #![allow(unused_variables)] -#![feature(debugger_visualizer)] #![debugger_visualizer(natvis_file = "embedded-visualizer.natvis")] #![debugger_visualizer(gdb_script_file = "embedded-visualizer.py")] diff --git a/tests/debuginfo/generic-method-on-generic-struct.rs b/tests/debuginfo/generic-method-on-generic-struct.rs index 97609ef5d..2d54c2b07 100644 --- a/tests/debuginfo/generic-method-on-generic-struct.rs +++ b/tests/debuginfo/generic-method-on-generic-struct.rs @@ -2,7 +2,7 @@ // Some versions of the non-rust-enabled LLDB print the wrong generic // parameter type names in this test. -// rust-lldb +// needs-rust-lldb // === GDB TESTS =================================================================================== diff --git a/tests/debuginfo/generic-struct.rs b/tests/debuginfo/generic-struct.rs index 5fa5ce800..5213eebc1 100644 --- a/tests/debuginfo/generic-struct.rs +++ b/tests/debuginfo/generic-struct.rs @@ -1,6 +1,6 @@ // Some versions of the non-rust-enabled LLDB print the wrong generic // parameter type names in this test. -// rust-lldb +// needs-rust-lldb // compile-flags:-g diff --git a/tests/debuginfo/generic-tuple-style-enum.rs b/tests/debuginfo/generic-tuple-style-enum.rs index 60362e54e..a55402691 100644 --- a/tests/debuginfo/generic-tuple-style-enum.rs +++ b/tests/debuginfo/generic-tuple-style-enum.rs @@ -1,6 +1,6 @@ // Require a gdb or lldb that can read DW_TAG_variant_part. // min-gdb-version: 8.2 -// rust-lldb +// needs-rust-lldb // compile-flags:-g diff --git a/tests/debuginfo/macro-stepping.rs b/tests/debuginfo/macro-stepping.rs index e4b2b7b79..a7287cffd 100644 --- a/tests/debuginfo/macro-stepping.rs +++ b/tests/debuginfo/macro-stepping.rs @@ -79,22 +79,28 @@ extern crate macro_stepping; // exports new_scope!() // lldb-check:[...]#inc-loc2[...] // lldb-command:next // lldb-command:frame select +// lldb-check:[...]#inc-loc1[...] +// lldb-command:next +// lldb-command:frame select +// lldb-check:[...]#inc-loc2[...] +// lldb-command:next +// lldb-command:frame select // lldb-check:[...]#inc-loc3[...] macro_rules! foo { () => { - let a = 1; - let b = 2; - let c = 3; - } + let a = 1; opaque(a); + let b = 2; opaque(b); + let c = 3; opaque(c); + }; } macro_rules! foo2 { () => { foo!(); - let x = 1; + let x = 1; opaque(x); foo!(); - } + }; } fn main() { @@ -118,4 +124,6 @@ fn main() { fn zzz() {()} +fn opaque(_: u32) {} + include!("macro-stepping.inc"); diff --git a/tests/debuginfo/method-on-generic-struct.rs b/tests/debuginfo/method-on-generic-struct.rs index bf0474491..138d8391d 100644 --- a/tests/debuginfo/method-on-generic-struct.rs +++ b/tests/debuginfo/method-on-generic-struct.rs @@ -1,6 +1,6 @@ // Some versions of the non-rust-enabled LLDB print the wrong generic // parameter type names in this test. -// rust-lldb +// needs-rust-lldb // compile-flags:-g diff --git a/tests/debuginfo/pretty-std.rs b/tests/debuginfo/pretty-std.rs index 7bb2810c2..c7df7dc3c 100644 --- a/tests/debuginfo/pretty-std.rs +++ b/tests/debuginfo/pretty-std.rs @@ -130,8 +130,8 @@ // cdb-check: [+0x000] __0 : "IAMA optional string!" [Type: alloc::string::String] // cdb-command: dx linkedlist -// cdb-check:linkedlist : { len=0x2 } [Type: alloc::collections::linked_list::LinkedList<i32>] -// cdb-check: [<Raw View>] [Type: alloc::collections::linked_list::LinkedList<i32>] +// cdb-check:linkedlist : { len=0x2 } [Type: alloc::collections::linked_list::LinkedList<i32,alloc::alloc::Global>] +// cdb-check: [<Raw View>] [Type: alloc::collections::linked_list::LinkedList<i32,alloc::alloc::Global>] // cdb-check: [0x0] : 128 [Type: int] // cdb-check: [0x1] : 42 [Type: int] diff --git a/tests/debuginfo/reference-debuginfo.rs b/tests/debuginfo/reference-debuginfo.rs new file mode 100644 index 000000000..85ade170a --- /dev/null +++ b/tests/debuginfo/reference-debuginfo.rs @@ -0,0 +1,173 @@ +// Copy of `borrowed-basic.rs` which enables the `ReferencePropagation` MIR pass. +// That pass replaces debuginfo for `a => _x` where `_x = &b` to be `a => &b`, +// and leaves codegen to create a ladder of allocations so as `*a == b`. +// +// compile-flags:-g -Zmir-enable-passes=+ReferencePropagation,-ConstDebugInfo +// min-lldb-version: 310 + +// === GDB TESTS =================================================================================== + +// gdb-command:run +// gdb-command:print *bool_ref +// gdb-check:$1 = true + +// gdb-command:print *int_ref +// gdb-check:$2 = -1 + +// gdb-command:print/d *char_ref +// gdb-check:$3 = 97 + +// gdb-command:print *i8_ref +// gdbg-check:$4 = 68 'D' +// gdbr-check:$4 = 68 + +// gdb-command:print *i16_ref +// gdb-check:$5 = -16 + +// gdb-command:print *i32_ref +// gdb-check:$6 = -32 + +// gdb-command:print *i64_ref +// gdb-check:$7 = -64 + +// gdb-command:print *uint_ref +// gdb-check:$8 = 1 + +// gdb-command:print *u8_ref +// gdbg-check:$9 = 100 'd' +// gdbr-check:$9 = 100 + +// gdb-command:print *u16_ref +// gdb-check:$10 = 16 + +// gdb-command:print *u32_ref +// gdb-check:$11 = 32 + +// gdb-command:print *u64_ref +// gdb-check:$12 = 64 + +// gdb-command:print *f32_ref +// gdb-check:$13 = 2.5 + +// gdb-command:print *f64_ref +// gdb-check:$14 = 3.5 + +// gdb-command:print *f64_double_ref +// gdb-check:$15 = 3.5 + + +// === LLDB TESTS ================================================================================== + +// lldb-command:run +// lldb-command:print *bool_ref +// lldbg-check:[...]$0 = true +// lldbr-check:(bool) *bool_ref = true + +// lldb-command:print *int_ref +// lldbg-check:[...]$1 = -1 +// lldbr-check:(isize) *int_ref = -1 + +// NOTE: only rust-enabled lldb supports 32bit chars +// lldbr-command:print *char_ref +// lldbr-check:(char) *char_ref = 'a' + +// lldb-command:print *i8_ref +// lldbg-check:[...]$2 = 'D' +// lldbr-check:(i8) *i8_ref = 68 + +// lldb-command:print *i16_ref +// lldbg-check:[...]$3 = -16 +// lldbr-check:(i16) *i16_ref = -16 + +// lldb-command:print *i32_ref +// lldbg-check:[...]$4 = -32 +// lldbr-check:(i32) *i32_ref = -32 + +// lldb-command:print *i64_ref +// lldbg-check:[...]$5 = -64 +// lldbr-check:(i64) *i64_ref = -64 + +// lldb-command:print *uint_ref +// lldbg-check:[...]$6 = 1 +// lldbr-check:(usize) *uint_ref = 1 + +// lldb-command:print *u8_ref +// lldbg-check:[...]$7 = 'd' +// lldbr-check:(u8) *u8_ref = 100 + +// lldb-command:print *u16_ref +// lldbg-check:[...]$8 = 16 +// lldbr-check:(u16) *u16_ref = 16 + +// lldb-command:print *u32_ref +// lldbg-check:[...]$9 = 32 +// lldbr-check:(u32) *u32_ref = 32 + +// lldb-command:print *u64_ref +// lldbg-check:[...]$10 = 64 +// lldbr-check:(u64) *u64_ref = 64 + +// lldb-command:print *f32_ref +// lldbg-check:[...]$11 = 2.5 +// lldbr-check:(f32) *f32_ref = 2.5 + +// lldb-command:print *f64_ref +// lldbg-check:[...]$12 = 3.5 +// lldbr-check:(f64) *f64_ref = 3.5 + +// lldb-command:print *f64_double_ref +// lldbg-check:[...]$13 = 3.5 +// lldbr-check:(f64) **f64_double_ref = 3.5 + +#![allow(unused_variables)] +#![feature(omit_gdb_pretty_printer_section)] +#![omit_gdb_pretty_printer_section] + +fn main() { + let bool_val: bool = true; + let bool_ref: &bool = &bool_val; + + let int_val: isize = -1; + let int_ref: &isize = &int_val; + + let char_val: char = 'a'; + let char_ref: &char = &char_val; + + let i8_val: i8 = 68; + let i8_ref: &i8 = &i8_val; + + let i16_val: i16 = -16; + let i16_ref: &i16 = &i16_val; + + let i32_val: i32 = -32; + let i32_ref: &i32 = &i32_val; + + let i64_val: i64 = -64; + let i64_ref: &i64 = &i64_val; + + let uint_val: usize = 1; + let uint_ref: &usize = &uint_val; + + let u8_val: u8 = 100; + let u8_ref: &u8 = &u8_val; + + let u16_val: u16 = 16; + let u16_ref: &u16 = &u16_val; + + let u32_val: u32 = 32; + let u32_ref: &u32 = &u32_val; + + let u64_val: u64 = 64; + let u64_ref: &u64 = &u64_val; + + let f32_val: f32 = 2.5; + let f32_ref: &f32 = &f32_val; + + let f64_val: f64 = 3.5; + let f64_ref: &f64 = &f64_val; + let f64_double_ref: &f64 = &f64_ref; + + zzz(); // #break +} + +fn zzz() {()} diff --git a/tests/debuginfo/struct-style-enum.rs b/tests/debuginfo/struct-style-enum.rs index 3d819e368..0152dd9ea 100644 --- a/tests/debuginfo/struct-style-enum.rs +++ b/tests/debuginfo/struct-style-enum.rs @@ -1,6 +1,6 @@ // Require a gdb or lldb that can read DW_TAG_variant_part. // min-gdb-version: 8.2 -// rust-lldb +// needs-rust-lldb // compile-flags:-g diff --git a/tests/debuginfo/thread.rs b/tests/debuginfo/thread.rs index 388d50c5c..e7e83c7aa 100644 --- a/tests/debuginfo/thread.rs +++ b/tests/debuginfo/thread.rs @@ -1,4 +1,4 @@ -// Testing the the display of JoinHandle and Thread in cdb. +// Testing the display of JoinHandle and Thread in cdb. // cdb-only // min-cdb-version: 10.0.18317.1001 diff --git a/tests/debuginfo/tuple-style-enum.rs b/tests/debuginfo/tuple-style-enum.rs index 39ead172e..60f3ecbd2 100644 --- a/tests/debuginfo/tuple-style-enum.rs +++ b/tests/debuginfo/tuple-style-enum.rs @@ -1,6 +1,6 @@ // Require a gdb or lldb that can read DW_TAG_variant_part. // min-gdb-version: 8.2 -// rust-lldb +// needs-rust-lldb // compile-flags:-g diff --git a/tests/debuginfo/unique-enum.rs b/tests/debuginfo/unique-enum.rs index d7dfaeefe..1ff6f5d9c 100644 --- a/tests/debuginfo/unique-enum.rs +++ b/tests/debuginfo/unique-enum.rs @@ -1,6 +1,6 @@ // Require a gdb or lldb that can read DW_TAG_variant_part. // min-gdb-version: 8.2 -// rust-lldb +// needs-rust-lldb // compile-flags:-g diff --git a/tests/debuginfo/unsized.rs b/tests/debuginfo/unsized.rs index b1ec9b068..3b8280bc4 100644 --- a/tests/debuginfo/unsized.rs +++ b/tests/debuginfo/unsized.rs @@ -1,4 +1,6 @@ // compile-flags:-g +// ignore-gdb-version: 13.1 - 99.0 +// ^ https://sourceware.org/bugzilla/show_bug.cgi?id=30330 // === GDB TESTS =================================================================================== |