[libcxx-commits] [libcxxabi] [llvm] [ItaniumDemangle][test] Turn ItaniumDemangle tests into LLVM unit-tests (PR #137947)

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 2 02:02:10 PDT 2025


mstorsjo wrote:

I have a couple of things to point out, which I think can explain most of these:

- The demangler, when operating in libcxxabi, only expects to be able to demangle strings from the current build configuration, hence the ifdefs for current architecture wrt long double and such. This is in quite in contrast to LLVM in general, where any build of LLVM expects to be able to deal with data from any target architecture. (I'm not sure how this is meant to work with the demangler in particular though - this is a preexisting issue.)

- Within libcxxabi, the demangler has only been tested in mingw build configurations, not in msvc build configurations, as the libcxxabi library isn't relevant (or even possible to compile) in MSVC mode. (Mingw configurations do have x87 80 bit long doubles on both i386 and x86_64, contrary to msvc build configurations that has 64 bit long doubles.) The windows buildbots build in msvc mode. (The libcxx CI does have mingw configurations though, and this testcase has been run in that configuration before.)

- The linux test failure probably is explained by the fact that the test currently uses `#if !LDBL_FP80` before the actual definition of `LDBL_FP80` further down in the file

- You seem to be on track with the Windows test failure (with the recently pushed amendment). With the Microsoft CRT, `printf("%a")` formats hex floats differently than most other C runtimes. This is the reason for the `XFAIL: win32-broken-printf-a-precision` in the current `libcxxabi/test/test_demangle.pass.cpp` - see ca69f515fe29fa98b7ab52e49c5b401bb22f64f6 for details about this. If those bits of the tests are removed from `libcxxabi/test/test_demangle.pass.cpp`, we probably should remove that `XFAIL` from there as well. (I can try to run a test configuration with that case on your PR when it is nearing completion to check this; this isn't covered in upstream CI.)

https://github.com/llvm/llvm-project/pull/137947


More information about the libcxx-commits mailing list