From 3bbd864c002c85f99614d86c8517b82710fe8d05 Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Fri, 9 Aug 2024 22:33:40 -0400 Subject: [PATCH 1/3] Enable debuginfo test which were disabled for years --- tests/debuginfo/basic-types-globals-metadata.rs | 1 - tests/debuginfo/basic-types-metadata.rs | 1 - tests/debuginfo/basic-types.rs | 3 --- tests/debuginfo/by-value-non-immediate-argument.rs | 1 - tests/debuginfo/c-style-enum.rs | 1 - tests/debuginfo/cross-crate-spans.rs | 4 ---- tests/debuginfo/destructured-for-loop-variable.rs | 4 ---- tests/debuginfo/drop-locations.rs | 1 - tests/debuginfo/function-arg-initialization.rs | 1 - tests/debuginfo/function-prologue-stepping-regular.rs | 1 - tests/debuginfo/lexical-scopes-in-block-expression.rs | 1 - tests/debuginfo/limited-debuginfo.rs | 1 - tests/debuginfo/macro-stepping.rs | 1 - tests/debuginfo/method-on-enum.rs | 1 - tests/debuginfo/option-like-enum.rs | 2 -- tests/debuginfo/simple-struct.rs | 1 - tests/debuginfo/simple-tuple.rs | 1 - tests/debuginfo/struct-in-enum.rs | 1 - tests/debuginfo/union-smoke.rs | 1 - tests/debuginfo/vec.rs | 1 - 20 files changed, 29 deletions(-) diff --git a/tests/debuginfo/basic-types-globals-metadata.rs b/tests/debuginfo/basic-types-globals-metadata.rs index d346b405555bc..13678c31e765b 100644 --- a/tests/debuginfo/basic-types-globals-metadata.rs +++ b/tests/debuginfo/basic-types-globals-metadata.rs @@ -1,5 +1,4 @@ //@ min-lldb-version: 310 -//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ compile-flags:-g // gdb-command:run diff --git a/tests/debuginfo/basic-types-metadata.rs b/tests/debuginfo/basic-types-metadata.rs index 5f953c81a138d..ce24314319a2e 100644 --- a/tests/debuginfo/basic-types-metadata.rs +++ b/tests/debuginfo/basic-types-metadata.rs @@ -1,5 +1,4 @@ //@ min-lldb-version: 310 -//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ compile-flags:-g // gdb-command:run diff --git a/tests/debuginfo/basic-types.rs b/tests/debuginfo/basic-types.rs index 10ffd74d3e909..d836525240ae2 100644 --- a/tests/debuginfo/basic-types.rs +++ b/tests/debuginfo/basic-types.rs @@ -6,9 +6,6 @@ //@ min-lldb-version: 310 -// This fails on lldb 6.0.1 on x86-64 Fedora 28; so ignore Linux for now. -//@ ignore-linux - //@ compile-flags:-g // === GDB TESTS =================================================================================== diff --git a/tests/debuginfo/by-value-non-immediate-argument.rs b/tests/debuginfo/by-value-non-immediate-argument.rs index e0ae4458d03e5..874d1ad77667e 100644 --- a/tests/debuginfo/by-value-non-immediate-argument.rs +++ b/tests/debuginfo/by-value-non-immediate-argument.rs @@ -1,4 +1,3 @@ -//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ min-lldb-version: 310 //@ compile-flags:-g diff --git a/tests/debuginfo/c-style-enum.rs b/tests/debuginfo/c-style-enum.rs index 395b94c59a445..2ab5d5ccf2cbe 100644 --- a/tests/debuginfo/c-style-enum.rs +++ b/tests/debuginfo/c-style-enum.rs @@ -1,5 +1,4 @@ //@ ignore-aarch64 -//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ min-lldb-version: 310 //@ compile-flags:-g diff --git a/tests/debuginfo/cross-crate-spans.rs b/tests/debuginfo/cross-crate-spans.rs index cf3f8e1eadf40..a93c8f46930e5 100644 --- a/tests/debuginfo/cross-crate-spans.rs +++ b/tests/debuginfo/cross-crate-spans.rs @@ -3,10 +3,6 @@ //@ min-lldb-version: 310 -// This fails on lldb 6.0.1 on x86-64 Fedora 28; so mark it macOS-only -// for now. -//@ only-macos - //@ aux-build:cross_crate_spans.rs extern crate cross_crate_spans; diff --git a/tests/debuginfo/destructured-for-loop-variable.rs b/tests/debuginfo/destructured-for-loop-variable.rs index 1cad8bcfacbe4..a8c7cc1489f62 100644 --- a/tests/debuginfo/destructured-for-loop-variable.rs +++ b/tests/debuginfo/destructured-for-loop-variable.rs @@ -1,9 +1,5 @@ //@ min-lldb-version: 310 -// This fails on lldb 6.0.1 on x86-64 Fedora 28; so mark it macOS-only -// for now. -//@ only-macos - //@ compile-flags:-g // === GDB TESTS =================================================================================== diff --git a/tests/debuginfo/drop-locations.rs b/tests/debuginfo/drop-locations.rs index 15b2d0de7fe99..c1f44e3da4783 100644 --- a/tests/debuginfo/drop-locations.rs +++ b/tests/debuginfo/drop-locations.rs @@ -1,6 +1,5 @@ //@ ignore-windows //@ ignore-android -//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ min-lldb-version: 310 #![allow(unused)] diff --git a/tests/debuginfo/function-arg-initialization.rs b/tests/debuginfo/function-arg-initialization.rs index 05935c30bea5d..2c0656cdd30c5 100644 --- a/tests/debuginfo/function-arg-initialization.rs +++ b/tests/debuginfo/function-arg-initialization.rs @@ -1,4 +1,3 @@ -//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ min-lldb-version: 310 // This test case checks if function arguments already have the correct value diff --git a/tests/debuginfo/function-prologue-stepping-regular.rs b/tests/debuginfo/function-prologue-stepping-regular.rs index a1f44105bb94a..7a536ae4a63d0 100644 --- a/tests/debuginfo/function-prologue-stepping-regular.rs +++ b/tests/debuginfo/function-prologue-stepping-regular.rs @@ -3,7 +3,6 @@ //@ min-lldb-version: 310 //@ ignore-gdb -//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ compile-flags:-g // lldb-command:breakpoint set --name immediate_args diff --git a/tests/debuginfo/lexical-scopes-in-block-expression.rs b/tests/debuginfo/lexical-scopes-in-block-expression.rs index 5ff70270ea62a..bd5a607586dc5 100644 --- a/tests/debuginfo/lexical-scopes-in-block-expression.rs +++ b/tests/debuginfo/lexical-scopes-in-block-expression.rs @@ -1,5 +1,4 @@ //@ min-lldb-version: 310 -//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ compile-flags:-g diff --git a/tests/debuginfo/limited-debuginfo.rs b/tests/debuginfo/limited-debuginfo.rs index 32f14955bfa31..2e49acd240170 100644 --- a/tests/debuginfo/limited-debuginfo.rs +++ b/tests/debuginfo/limited-debuginfo.rs @@ -1,5 +1,4 @@ //@ ignore-lldb -//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ compile-flags:-C debuginfo=1 diff --git a/tests/debuginfo/macro-stepping.rs b/tests/debuginfo/macro-stepping.rs index 5f8d82871681f..c1201286b34da 100644 --- a/tests/debuginfo/macro-stepping.rs +++ b/tests/debuginfo/macro-stepping.rs @@ -2,7 +2,6 @@ //@ ignore-android //@ ignore-aarch64 //@ min-lldb-version: 310 -//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ aux-build:macro-stepping.rs diff --git a/tests/debuginfo/method-on-enum.rs b/tests/debuginfo/method-on-enum.rs index 8a57060717e47..f087564442a4c 100644 --- a/tests/debuginfo/method-on-enum.rs +++ b/tests/debuginfo/method-on-enum.rs @@ -1,5 +1,4 @@ //@ min-lldb-version: 310 -//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ compile-flags:-g diff --git a/tests/debuginfo/option-like-enum.rs b/tests/debuginfo/option-like-enum.rs index c782796f47316..a35dd539581f2 100644 --- a/tests/debuginfo/option-like-enum.rs +++ b/tests/debuginfo/option-like-enum.rs @@ -1,5 +1,3 @@ -//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 - //@ min-lldb-version: 310 //@ compile-flags:-g diff --git a/tests/debuginfo/simple-struct.rs b/tests/debuginfo/simple-struct.rs index 968a5c63e89a3..aaa654aeb7a67 100644 --- a/tests/debuginfo/simple-struct.rs +++ b/tests/debuginfo/simple-struct.rs @@ -1,5 +1,4 @@ //@ min-lldb-version: 310 -//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ compile-flags: -g -Zmir-enable-passes=-CheckAlignment diff --git a/tests/debuginfo/simple-tuple.rs b/tests/debuginfo/simple-tuple.rs index 86003105f360e..9d809a11cac52 100644 --- a/tests/debuginfo/simple-tuple.rs +++ b/tests/debuginfo/simple-tuple.rs @@ -1,5 +1,4 @@ //@ min-lldb-version: 310 -//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ compile-flags:-g diff --git a/tests/debuginfo/struct-in-enum.rs b/tests/debuginfo/struct-in-enum.rs index 52e419e6b4745..dfcef4e0f8e2e 100644 --- a/tests/debuginfo/struct-in-enum.rs +++ b/tests/debuginfo/struct-in-enum.rs @@ -1,6 +1,5 @@ //@ min-lldb-version: 310 //@ ignore-gdb-version: 7.11.90 - 7.12.9 -//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ compile-flags:-g diff --git a/tests/debuginfo/union-smoke.rs b/tests/debuginfo/union-smoke.rs index 9b1cf6e1e95c9..d786ba612714a 100644 --- a/tests/debuginfo/union-smoke.rs +++ b/tests/debuginfo/union-smoke.rs @@ -1,5 +1,4 @@ //@ min-lldb-version: 310 -//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ ignore-gdb-version: 7.11.90 - 7.12.9 diff --git a/tests/debuginfo/vec.rs b/tests/debuginfo/vec.rs index cf7de0b9b5519..20cfd785ca7f0 100644 --- a/tests/debuginfo/vec.rs +++ b/tests/debuginfo/vec.rs @@ -1,5 +1,4 @@ //@ min-lldb-version: 310 -//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 //@ compile-flags:-g From 1bc13837415ab385582e75b35d13b5523b78d6d2 Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Sat, 10 Aug 2024 01:19:58 -0400 Subject: [PATCH 2/3] Fix tests locally? --- tests/debuginfo/basic-types-metadata.rs | 20 +++++++++---------- tests/debuginfo/drop-locations.rs | 4 ++-- .../debuginfo/function-arg-initialization.rs | 2 +- tests/debuginfo/macro-stepping.rs | 2 +- tests/debuginfo/option-like-enum.rs | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/debuginfo/basic-types-metadata.rs b/tests/debuginfo/basic-types-metadata.rs index ce24314319a2e..3aebf2577b6b3 100644 --- a/tests/debuginfo/basic-types-metadata.rs +++ b/tests/debuginfo/basic-types-metadata.rs @@ -35,12 +35,12 @@ // gdb-command:whatis f64 // gdb-check:type = f64 // gdb-command:whatis fnptr -// gdb-check:type = [...] (*)([...]) +// gdb-check:type = *mut fn () // gdb-command:info functions _yyy // gdbg-check:[...]![...]_yyy([...]); -// gdbr-check:static fn basic_types_metadata::_yyy() -> !; +// gdbr-check:static fn basic_types_metadata::_yyy(); // gdb-command:ptype closure_0 -// gdbr-check: type = struct closure +// gdbr-check: type = struct basic_types_metadata::main::{closure_env#0} // gdbg-check: type = struct closure { // gdbg-check: // gdbg-check: } @@ -48,18 +48,18 @@ // gdbg-check: type = struct closure { // gdbg-check: bool *__0; // gdbg-check: } -// gdbr-check: type = struct closure ( -// gdbr-check: bool *, -// gdbr-check: ) +// gdbr-check: type = struct basic_types_metadata::main::{closure_env#1} { +// gdbr-check: *mut bool, +// gdbr-check: } // gdb-command:ptype closure_2 // gdbg-check: type = struct closure { // gdbg-check: bool *__0; // gdbg-check: isize *__1; // gdbg-check: } -// gdbr-check: type = struct closure ( -// gdbr-check: bool *, -// gdbr-check: isize *, -// gdbr-check: ) +// gdbr-check: type = struct basic_types_metadata::main::{closure_env#2} { +// gdbr-check: *mut bool, +// gdbr-check: *mut isize, +// gdbr-check: } // // gdb-command:continue diff --git a/tests/debuginfo/drop-locations.rs b/tests/debuginfo/drop-locations.rs index c1f44e3da4783..221c30ac59e57 100644 --- a/tests/debuginfo/drop-locations.rs +++ b/tests/debuginfo/drop-locations.rs @@ -1,11 +1,11 @@ //@ ignore-windows //@ ignore-android //@ min-lldb-version: 310 +//@ ignore-test #![allow(unused)] -//@ compile-flags:-g -O -C no-prepopulate-passes -// -O -C no-prepopulate-passes added to work around https://bugs.llvm.org/show_bug.cgi?id=32123 +//@ compile-flags:-g // This test checks that drop glue code gets attributed to scope's closing brace, // and function epilogues - to function's closing brace. diff --git a/tests/debuginfo/function-arg-initialization.rs b/tests/debuginfo/function-arg-initialization.rs index 2c0656cdd30c5..87604930ed5f3 100644 --- a/tests/debuginfo/function-arg-initialization.rs +++ b/tests/debuginfo/function-arg-initialization.rs @@ -7,7 +7,7 @@ // arguments have been properly loaded when setting the breakpoint via the // function name. -//@ compile-flags:-g +//@ compile-flags:-g -Zmir-enable-passes=-SingleUseConsts // === GDB TESTS =================================================================================== diff --git a/tests/debuginfo/macro-stepping.rs b/tests/debuginfo/macro-stepping.rs index c1201286b34da..bb465d9fb2932 100644 --- a/tests/debuginfo/macro-stepping.rs +++ b/tests/debuginfo/macro-stepping.rs @@ -10,7 +10,7 @@ #[macro_use] extern crate macro_stepping; // exports new_scope!() -//@ compile-flags:-g +//@ compile-flags:-g -Zmir-enable-passes=-SingleUseConsts // === GDB TESTS =================================================================================== diff --git a/tests/debuginfo/option-like-enum.rs b/tests/debuginfo/option-like-enum.rs index a35dd539581f2..96acd13c83e08 100644 --- a/tests/debuginfo/option-like-enum.rs +++ b/tests/debuginfo/option-like-enum.rs @@ -20,7 +20,7 @@ // gdbg-command:print empty_gdb->discr // gdbr-command:print empty_gdb.discr -// gdb-check:$4 = (isize *) 0x0 +// gdb-check:$4 = (*mut isize) 0x1 // gdb-command:print droid // gdbg-check:$5 = {RUST$ENCODED$ENUM$2$Void = {id = 675675, range = 10000001, internals = 0x43218765}} @@ -28,11 +28,11 @@ // gdbg-command:print void_droid_gdb->internals // gdbr-command:print void_droid_gdb.internals -// gdb-check:$6 = (isize *) 0x0 +// gdb-check:$6 = (*mut isize) 0x1 // gdb-command:print nested_non_zero_yep // gdbg-check:$7 = {RUST$ENCODED$ENUM$1$2$Nope = {__0 = 10.5, __1 = {a = 10, b = 20, c = [...]}}} -// gdbr-check:$7 = option_like_enum::NestedNonZero::Yep(10.5, option_like_enum::NestedNonZeroField {a: 10, b: 20, c: 0x[...] "x[...]"}) +// gdbr-check:$7 = option_like_enum::NestedNonZero::Yep(10.5, option_like_enum::NestedNonZeroField {a: 10, b: 20, c: 0x[...]}) // gdb-command:print nested_non_zero_nope // gdbg-check:$8 = {RUST$ENCODED$ENUM$1$2$Nope = {__0 = [...], __1 = {a = [...], b = [...], c = 0x0}}} From b37d94fcfe62a88e7aaf08904f71273900202c69 Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Sat, 10 Aug 2024 09:26:12 -0400 Subject: [PATCH 3/3] Try to fix more tests --- tests/debuginfo/by-value-non-immediate-argument.rs | 6 +++--- tests/debuginfo/function-arg-initialization.rs | 2 +- tests/debuginfo/function-prologue-stepping-regular.rs | 2 +- tests/debuginfo/method-on-enum.rs | 2 +- tests/debuginfo/struct-in-enum.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/debuginfo/by-value-non-immediate-argument.rs b/tests/debuginfo/by-value-non-immediate-argument.rs index 874d1ad77667e..229d0d2bfbfcb 100644 --- a/tests/debuginfo/by-value-non-immediate-argument.rs +++ b/tests/debuginfo/by-value-non-immediate-argument.rs @@ -1,6 +1,6 @@ //@ min-lldb-version: 310 -//@ compile-flags:-g +//@ compile-flags:-g -Zmir-enable-passes=-SingleUseConsts // === GDB TESTS =================================================================================== @@ -41,11 +41,11 @@ // lldb-command:run // lldb-command:v s -// lldb-check:[...] Struct { a: 1, b: 2.5 } +// lldb-check:[...] Struct { a = 1 b = 2.5 } // lldb-command:continue // lldb-command:v x -// lldb-check:[...] Struct { a: 3, b: 4.5 } +// lldb-check:[...] Struct { a = 3 b = 4.5 } // lldb-command:v y // lldb-check:[...] 5 // lldb-command:v z diff --git a/tests/debuginfo/function-arg-initialization.rs b/tests/debuginfo/function-arg-initialization.rs index 87604930ed5f3..2cb65eb530007 100644 --- a/tests/debuginfo/function-arg-initialization.rs +++ b/tests/debuginfo/function-arg-initialization.rs @@ -7,7 +7,7 @@ // arguments have been properly loaded when setting the breakpoint via the // function name. -//@ compile-flags:-g -Zmir-enable-passes=-SingleUseConsts +//@ compile-flags:-g -Zmir-opt-level=0 // === GDB TESTS =================================================================================== diff --git a/tests/debuginfo/function-prologue-stepping-regular.rs b/tests/debuginfo/function-prologue-stepping-regular.rs index 7a536ae4a63d0..ebb3dff8ff9e6 100644 --- a/tests/debuginfo/function-prologue-stepping-regular.rs +++ b/tests/debuginfo/function-prologue-stepping-regular.rs @@ -3,7 +3,7 @@ //@ min-lldb-version: 310 //@ ignore-gdb -//@ compile-flags:-g +//@ compile-flags:-g -Zmir-enable-passes=-SingleUseConsts // lldb-command:breakpoint set --name immediate_args // lldb-command:breakpoint set --name non_immediate_args diff --git a/tests/debuginfo/method-on-enum.rs b/tests/debuginfo/method-on-enum.rs index f087564442a4c..7a96844dc2baa 100644 --- a/tests/debuginfo/method-on-enum.rs +++ b/tests/debuginfo/method-on-enum.rs @@ -1,6 +1,6 @@ //@ min-lldb-version: 310 -//@ compile-flags:-g +//@ compile-flags:-g -Zmir-opt-level=0 // === GDB TESTS =================================================================================== diff --git a/tests/debuginfo/struct-in-enum.rs b/tests/debuginfo/struct-in-enum.rs index dfcef4e0f8e2e..c1d1d19347b96 100644 --- a/tests/debuginfo/struct-in-enum.rs +++ b/tests/debuginfo/struct-in-enum.rs @@ -1,7 +1,7 @@ //@ min-lldb-version: 310 //@ ignore-gdb-version: 7.11.90 - 7.12.9 -//@ compile-flags:-g +//@ compile-flags:-g -Zmir-opt-level=0 // === GDB TESTS ===================================================================================