Skip to content

[libcxx] [test] Enable gdb_pretty_printer_test.sh.cpp for clang #102893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

mstorsjo
Copy link
Member

@mstorsjo mstorsjo commented Aug 12, 2024

With current versions the CI image, this test does pass, with both Clang 17, 18 and 19 - so there doesn't seem to be anything Clang version specific in it.

… Windows

In practice, this test hasn't been run by any of the Windows
configurations so far, because it has been excluded by the
"UNSUPPORTED: clang-18, clang-19" line - but it does end up
failing if running with e.g. clang-20 on Windows.

As the test fails on more fundamental issues on Windows, mark
it outright unsupported on this platform; this fixes testing
libcxx with a recent nightly version of Clang from git main.
@mstorsjo mstorsjo requested a review from a team as a code owner August 12, 2024 12:39
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Aug 12, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 12, 2024

@llvm/pr-subscribers-libcxx

Author: Martin Storsjö (mstorsjo)

Changes

With current versions of clang-19 in the CI image, this test does pass.


Full diff: https://github.com/llvm/llvm-project/pull/102893.diff

1 Files Affected:

  • (modified) libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp (+4-1)
diff --git a/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp b/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
index 4c2b483914f47e..0645df0ebd498f 100644
--- a/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
+++ b/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
@@ -12,7 +12,7 @@
 // UNSUPPORTED: c++03
 
 // TODO: Investigate these failures which break the CI.
-// UNSUPPORTED: clang-17, clang-18, clang-19
+// UNSUPPORTED: clang-17, clang-18
 
 // The Android libc++ tests are run on a non-Android host, connected to an
 // Android device over adb. gdb needs special support to make this work (e.g.
@@ -20,6 +20,9 @@
 // support gdb anymore, favoring lldb instead.
 // UNSUPPORTED: android
 
+// This test doesn't work as such on Windows.
+// UNSUPPORTED: windows
+
 // RUN: %{cxx} %{flags} %s -o %t.exe %{compile_flags} -g %{link_flags}
 // Ensure locale-independence for unicode tests.
 // RUN: env LANG=en_US.UTF-8 %{gdb} -nx -batch -iex "set autoload off" -ex "source %S/../../../utils/gdb/libcxx/printers.py" -ex "python register_libcxx_printer_loader()" -ex "source %S/gdb_pretty_printer_test.py" %t.exe

@mstorsjo
Copy link
Member Author

This goes on top of #102891. This test does pass at least in the generic-cxx26 configuration with the current CI docker image - let's see what happens with a full run of the CI.

Copy link
Contributor

@philnik777 philnik777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also work for older clang versions?

@mstorsjo
Copy link
Member Author

Does this also work for older clang versions?

Actually, yes, it seems to run fine in the current CI environments with all clang versions. I guess it can easily fail in users' own local checkouts though, but in that case we should probably add a more finegrained REQUIRES for the test. There doesn't seem to be anything related to the clang version itself here at least.

With current versions the CI image, this test does pass, with
both Clang 17, 18 and 19 - so there doesn't seem to be anything
Clang version specific in it.
@mstorsjo mstorsjo force-pushed the libcxx-test-gdb-clang branch from b6dcc31 to 4e72b6d Compare August 12, 2024 13:14
@mstorsjo mstorsjo changed the title [libcxx] [test] Enable gdb_pretty_printer_test.sh.cpp for clang-19 [libcxx] [test] Enable gdb_pretty_printer_test.sh.cpp for clang Aug 12, 2024
@mstorsjo
Copy link
Member Author

Does this also work for older clang versions?

Actually, yes, it seems to run fine in the current CI environments with all clang versions. I guess it can easily fail in users' own local checkouts though, but in that case we should probably add a more finegrained REQUIRES for the test. There doesn't seem to be anything related to the clang version itself here at least.

This change seems to run fine in all our CI configs, except for the generic-optimized-speed config, which seems to lack the relevant symbols or something like that: https://github.com/llvm/llvm-project/actions/runs/10352053007/job/28662445559

So we can't merge this as is. I guess that optimized builds of the tests don't work with this test... Anyway, this PR was only a side quest for me, so I'll leave this up to someone else to pick up and finish...

@mstorsjo
Copy link
Member Author

I ran into another case where this fails on Linux - the situation seems to be that my host GDB doesn't understand DWARF 5, but Clang defaults to that. Adding a -gdwarf-4 to the build command fixes that.

So this test seems quite picky with the surrounding environment, and is quite prone to breakage when run in various user environments.

@mstorsjo
Copy link
Member Author

Closing this one; while it could be worthwhile to do, it's quite messy and I'm not going to pursue it.

@mstorsjo mstorsjo closed this Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants