[all-commits] [llvm/llvm-project] 4dd5c2: [lit] Don't expand escapes until all substitutions...
Sergej Jaskiewicz via All-commits
all-commits at lists.llvm.org
Mon Jul 27 08:09:31 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 4dd5c2bee366514cbc3fc4e6da46462bc11a0a3d
https://github.com/llvm/llvm-project/commit/4dd5c2bee366514cbc3fc4e6da46462bc11a0a3d
Author: Sergej Jaskiewicz <jaskiewiczs at icloud.com>
Date: 2020-07-27 (Mon, 27 Jul 2020)
Changed paths:
M llvm/utils/lit/lit/TestRunner.py
A llvm/utils/lit/tests/Inputs/shtest-recursive-substitution/escaping/lit.cfg
A llvm/utils/lit/tests/Inputs/shtest-recursive-substitution/escaping/test.py
M llvm/utils/lit/tests/shtest-recursive-substitution.py
Log Message:
-----------
[lit] Don't expand escapes until all substitutions have been applied
Otherwise, if a Lit script contains escaped substitutions (like %%p in this test https://github.com/llvm/llvm-project/blob/master/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-partial-report-with-module-map.cpp#L10), they are unescaped during recursive application of substitutions, and the results are unexpected.
We solve it using the fact that double percent signs are first replaced with #_MARKER_#, and only after all the other substitutions have been applied, #_MARKER_# is replaced with a single percent sign. The only change is that instead of replacing #_MARKER_# at each recursion step, we replace it once after the last recursion step.
Differential Revision: https://reviews.llvm.org/D83894
More information about the All-commits
mailing list