From 557a932757fd54f070a3bab0d39f578ae0d8f759 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Fri, 22 Jan 2021 16:42:35 -0800 Subject: [PATCH] Fix GitHub Actions config (actually run gdb tests on new backend). I had missed that the CI config didn't actually run the tests, because (I think) `matrix.target` is not set by default (?). All of our hosts are native x86-64, so we can just gate on OS (Ubuntu) instead. I also discovered that while I had been testing with the gdb tests locally, when *all* `debug::*` tests are run, there are two that do not pass on the new backend because of specific differences in compiled code. One is a value-lifetime issue (the value is "optimized out" at the point the breakpoint is set) and the other has to do with basic-block order (it is trying to match against hardcoded machine-code offsets which have changed). --- .github/workflows/main.yml | 4 ++-- tests/all/debug/lldb.rs | 6 +++++- tests/all/debug/translate.rs | 6 +++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c954cf6595..936fd61788 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -295,8 +295,8 @@ jobs: # Test debug (DWARF) related functionality on new backend. - run: | sudo apt-get update && sudo apt-get install -y gdb - cargo test --features experimental_x64 test_debug_dwarf -- --ignored --test-threads 1 - if: matrix.target == 'x86_64-unknown-linux-gnu' + cargo test --features experimental_x64 test_debug_dwarf -- --ignored --test-threads 1 --test debug:: + if: matrix.os == 'ubuntu-latest' env: RUST_BACKTRACE: 1 diff --git a/tests/all/debug/lldb.rs b/tests/all/debug/lldb.rs index c29e757b31..7807732700 100644 --- a/tests/all/debug/lldb.rs +++ b/tests/all/debug/lldb.rs @@ -137,7 +137,11 @@ check: exited with status #[ignore] #[cfg(all( any(target_os = "linux", target_os = "macos"), - target_pointer_width = "64" + target_pointer_width = "64", + // Ignore test on new backend. The value this is looking for is + // not available at the point that the breakpoint is set when + // compiled by the new backend. + not(feature = "experimental_x64"), ))] pub fn test_debug_dwarf_ptr() -> Result<()> { let output = lldb_with_script( diff --git a/tests/all/debug/translate.rs b/tests/all/debug/translate.rs index e8ceb7bd9e..7253989d57 100644 --- a/tests/all/debug/translate.rs +++ b/tests/all/debug/translate.rs @@ -114,7 +114,11 @@ check: DW_AT_decl_line (10) #[cfg(all( any(target_os = "linux", target_os = "macos"), target_arch = "x86_64", - target_pointer_width = "64" + target_pointer_width = "64", + // Ignore test on new backend. This is a specific test with hardcoded + // offsets and the new backend compiles the return basic-block at a different + // offset, causing mismatches. + not(feature = "experimental_x64"), ))] fn test_debug_dwarf5_translate_lines() -> Result<()> { check_line_program(