[all-commits] [llvm/llvm-project] 3dc703: [lit] Fix shell commands with newlines (#67898)
Joel E. Denny via All-commits
all-commits at lists.llvm.org
Tue Oct 3 07:00:36 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 3dc7039f244f5da7368b8ba2f0e419c7d851c851
https://github.com/llvm/llvm-project/commit/3dc7039f244f5da7368b8ba2f0e419c7d851c851
Author: Joel E. Denny <jdenny.ornl at gmail.com>
Date: 2023-10-03 (Tue, 03 Oct 2023)
Changed paths:
M llvm/utils/lit/lit/TestRunner.py
M llvm/utils/lit/tests/Inputs/shtest-inject/lit.cfg
M llvm/utils/lit/tests/Inputs/shtest-run-at-line/external-shell/lit.local.cfg
A llvm/utils/lit/tests/Inputs/shtest-run-at-line/external-shell/run-line-with-newline.txt
M llvm/utils/lit/tests/Inputs/shtest-run-at-line/internal-shell/lit.local.cfg
A llvm/utils/lit/tests/Inputs/shtest-run-at-line/internal-shell/run-line-with-newline.txt
M llvm/utils/lit/tests/shtest-inject.py
M llvm/utils/lit/tests/shtest-run-at-line.py
Log Message:
-----------
[lit] Fix shell commands with newlines (#67898)
In PR #65242 (landed as 9e739fdb85ac672f3e25e971d96e71823e07ebda), I
claimed that RUN lines cannot contain newlines. Actually, they can after
substitution expansion. More generally, a lit config file can define
substitutions or preamble commands containing newlines. While both of
those cases seem unlikely in practice,
[D154987](https://reviews.llvm.org/D154987) proposes PYTHON directives
where it seems very likely.
Regardless of the use case, without this patch, such newlines break
expansion of `%dbg(RUN: at line N)`, and the fix is simple.
More information about the All-commits
mailing list