[libc++][utils] Fix LIT %if substitution support (#209358)

Update the applySubstitutions call in `libcxx/utils/libcxx/test/format.py` to match the
change to `llvm/utils/lit/lit/TestRunner.py` done in 1041a9642b.
This commit is contained in:
Hubert Tong 2026-07-20 09:36:43 -04:00 committed by GitHub
parent 743813d100
commit a8617034c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1,11 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// Make sure that LIT `%if` substitutions are aware of the available features.
// RUN: not %if target={{.+}} %{ not %} echo "hello world"

View file

@ -205,8 +205,12 @@ def parseScript(test, preamble):
)
# Perform substitutions in the script itself.
conditions = {feature: True for feature in test.config.available_features}
script = lit.TestRunner.applySubstitutions(
script, substitutions, recursion_limit=test.config.recursiveExpansionLimit
script,
substitutions,
conditions,
recursion_limit=test.config.recursiveExpansionLimit,
)
return script