[all-commits] [llvm/llvm-project] 4e2216: [libc++][test] `ADDITIONAL_COMPILE_FLAGS` should b...

Stephan T. Lavavej via All-commits all-commits at lists.llvm.org
Thu Nov 30 13:55:06 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e2216e184a2ba4b9e7e40b3cfa11e0c516a6ed6
      https://github.com/llvm/llvm-project/commit/4e2216e184a2ba4b9e7e40b3cfa11e0c516a6ed6
  Author: Stephan T. Lavavej <stl at nuwen.net>
  Date:   2023-11-30 (Thu, 30 Nov 2023)

  Changed paths:
    M libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp
    M libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-run.sh.cpp
    M libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.pass.cpp
    M libcxx/utils/libcxx/test/format.py
    M llvm/utils/lit/lit/TestRunner.py
    M llvm/utils/lit/tests/Inputs/testrunner-custom-parsers/test.txt
    M llvm/utils/lit/tests/unit/TestRunner.py

  Log Message:
  -----------
  [libc++][test] `ADDITIONAL_COMPILE_FLAGS` should be a space-separated list (#73541)

Found while running libc++'s test suite with MSVC's STL.

`ADDITIONAL_COMPILE_FLAGS` is a `ParserKind.LIST`:

https://github.com/llvm/llvm-project/blob/3c23ed156f0151923b168bdff0c34ec73fb37f38/libcxx/utils/libcxx/test/format.py#L104-L108

With a comma-separated example:

https://github.com/llvm/llvm-project/blob/3c23ed156f0151923b168bdff0c34ec73fb37f38/libcxx/utils/libcxx/test/format.py#L223-L228

And comma-separated test coverage:

https://github.com/llvm/llvm-project/blob/dd3184c30ff531b8aecea280e65233337dd02815/libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-run.sh.cpp#L12-L15

Because the machinery splits on commas:

https://github.com/llvm/llvm-project/blob/dd09221a29506031415cad8a1308998358633d48/llvm/utils/lit/lit/TestRunner.py#L1882-L1883

https://github.com/llvm/llvm-project/blob/dd09221a29506031415cad8a1308998358633d48/llvm/utils/lit/lit/TestRunner.py#L1951-L1956

However, most (although not all) usage of `ADDITIONAL_COMPILE_FLAGS` is
treating it as space-separated. That apparently works in the normal
Clang environment, but in my exotic configuration it causes `"-DMEOW
-DWOOF"` to be passed as a single argument to MSVC, which then emits
"warning C5102: ignoring invalid command-line macro definition
`'_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT'`", causing test failures due to
warnings-as-errors.

This PR changes `ADDITIONAL_COMPILE_FLAGS` to actually be parsed as a
space-separated list, and changes the few uses/examples that had commas.




More information about the All-commits mailing list