Skip to content

Commit b16ad15

Browse files
Merge branch 'main' into issue_165161
2 parents 9eacdf5 + 25afea7 commit b16ad15

File tree

10 files changed

+27
-21
lines changed

10 files changed

+27
-21
lines changed

lld/ELF/SyntheticSections.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2749,14 +2749,13 @@ RelroPaddingSection::RelroPaddingSection(Ctx &ctx)
27492749
: SyntheticSection(ctx, ".relro_padding", SHT_NOBITS, SHF_ALLOC | SHF_WRITE,
27502750
1) {}
27512751

2752-
RandomizePaddingSection::RandomizePaddingSection(Ctx &ctx, uint64_t size,
2753-
OutputSection *parent)
2754-
: SyntheticSection(ctx, ".randomize_padding", SHT_PROGBITS, SHF_ALLOC, 1),
2752+
PaddingSection::PaddingSection(Ctx &ctx, uint64_t size, OutputSection *parent)
2753+
: SyntheticSection(ctx, ".padding", SHT_PROGBITS, SHF_ALLOC, 1),
27552754
size(size) {
27562755
this->parent = parent;
27572756
}
27582757

2759-
void RandomizePaddingSection::writeTo(uint8_t *buf) {
2758+
void PaddingSection::writeTo(uint8_t *buf) {
27602759
std::array<uint8_t, 4> filler = getParent()->getFiller(ctx);
27612760
uint8_t *end = buf + size;
27622761
for (; buf + 4 <= end; buf += 4)

lld/ELF/SyntheticSections.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,11 +779,11 @@ class RelroPaddingSection final : public SyntheticSection {
779779
void writeTo(uint8_t *buf) override {}
780780
};
781781

782-
class RandomizePaddingSection final : public SyntheticSection {
782+
class PaddingSection final : public SyntheticSection {
783783
uint64_t size;
784784

785785
public:
786-
RandomizePaddingSection(Ctx &ctx, uint64_t size, OutputSection *parent);
786+
PaddingSection(Ctx &ctx, uint64_t size, OutputSection *parent);
787787
size_t getSize() const override { return size; }
788788
void writeTo(uint8_t *buf) override;
789789
};

lld/ELF/Writer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,15 +1495,14 @@ static void randomizeSectionPadding(Ctx &ctx) {
14951495
if (auto *isd = dyn_cast<InputSectionDescription>(bc)) {
14961496
SmallVector<InputSection *, 0> tmp;
14971497
if (os->ptLoad != curPtLoad) {
1498-
tmp.push_back(make<RandomizePaddingSection>(
1499-
ctx, g() % ctx.arg.maxPageSize, os));
1498+
tmp.push_back(
1499+
make<PaddingSection>(ctx, g() % ctx.arg.maxPageSize, os));
15001500
curPtLoad = os->ptLoad;
15011501
}
15021502
for (InputSection *isec : isd->sections) {
15031503
// Probability of inserting padding is 1 in 16.
15041504
if (g() % 16 == 0)
1505-
tmp.push_back(
1506-
make<RandomizePaddingSection>(ctx, isec->addralign, os));
1505+
tmp.push_back(make<PaddingSection>(ctx, isec->addralign, os));
15071506
tmp.push_back(isec);
15081507
}
15091508
isd->sections = std::move(tmp);

lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# https://github.com/llvm/llvm-project/issues/137660
1717
@skipIf(oslist=["windows"], archs=["aarch64"])
1818
# The Arm Linux bot needs stable resources before it can run these tests reliably.
19-
@skipif(oslist=["linux"], archs=["arm$"])
19+
@skipIf(oslist=["linux"], archs=["arm$"])
2020
class DAPTestCaseBase(TestBase):
2121
# set timeout based on whether ASAN was enabled or not. Increase
2222
# timeout by a factor of 10 if ASAN is enabled.

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8340,11 +8340,7 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(
83408340
&R) ||
83418341
(isa<VPInstruction>(&R) && !UnderlyingValue))
83428342
continue;
8343-
8344-
// FIXME: VPlan0, which models a copy of the original scalar loop, should
8345-
// not use VPWidenPHIRecipe to model the phis.
8346-
assert((isa<VPWidenPHIRecipe>(&R) || isa<VPInstruction>(&R)) &&
8347-
UnderlyingValue && "unsupported recipe");
8343+
assert(isa<VPInstruction>(&R) && UnderlyingValue && "unsupported recipe");
83488344

83498345
// TODO: Gradually replace uses of underlying instruction by analyses on
83508346
// VPlan.

llvm/utils/lit/lit/TestRunner.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,10 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
826826
not_args = []
827827
not_count = 0
828828
not_crash = False
829+
830+
# Expand all late substitutions.
831+
args = _expandLateSubstitutions(j, args, cmd_shenv.cwd)
832+
829833
while True:
830834
if args[0] == "env":
831835
# Create a copy of the global environment and modify it for
@@ -875,9 +879,6 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
875879
# Ensure args[0] is hashable.
876880
args[0] = expand_glob(args[0], cmd_shenv.cwd)[0]
877881

878-
# Expand all late substitutions.
879-
args = _expandLateSubstitutions(j, args, cmd_shenv.cwd)
880-
881882
inproc_builtin = inproc_builtins.get(args[0], None)
882883
if inproc_builtin and (args[0] != "echo" or len(cmd.commands) == 1):
883884
# env calling an in-process builtin is useless, so we take the safe
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Tests that readfile works with the env builtin.
2+
# RUN: echo -n "hello" > %t.1
3+
# RUN: env TEST=%{readfile:%t.1} %{python} -c "import os; print(os.environ['TEST'])"
4+
5+
## Fail the test so we can assert on the output.
6+
# RUN: not echo return

llvm/utils/lit/tests/Inputs/shtest-readfile/lit.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
1010
config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
1111
config.test_source_root = None
1212
config.test_exec_root = None
13+
config.substitutions.append(("%{python}", '"%s"' % (sys.executable)))
1314

1415
# If we are testing with the external shell, remove the fake-externals from
1516
# PATH so that we use mkdir in the tests.

llvm/utils/lit/tests/shtest-readfile-external.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# UNSUPPORTED: system-windows
77
# RUN: env LIT_USE_INTERNAL_SHELL=0 not %{lit} -a -v %{inputs}/shtest-readfile | FileCheck -match-full-lines -DTEMP_PATH=%S/Inputs/shtest-readfile/Output %s
88

9-
# CHECK: -- Testing: 4 tests{{.*}}
9+
# CHECK: -- Testing: 5 tests{{.*}}
1010

1111
# CHECK-LABEL: FAIL: shtest-readfile :: absolute-paths.txt ({{[^)]*}})
1212
# CHECK: echo $(cat [[TEMP_PATH]]/absolute-paths.txt.tmp) && test -e [[TEMP_PATH]]/absolute-paths.txt.tmp {{.*}}

llvm/utils/lit/tests/shtest-readfile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55

66
# RUN: env LIT_USE_INTERNAL_SHELL=1 not %{lit} -a -v %{inputs}/shtest-readfile | FileCheck -match-full-lines -DTEMP_PATH=%S%{fs-sep}Inputs%{fs-sep}shtest-readfile%{fs-sep}Output %s
77

8-
# CHECK: -- Testing: 4 tests{{.*}}
8+
# CHECK: -- Testing: 5 tests{{.*}}
99

1010
# CHECK-LABEL: FAIL: shtest-readfile :: absolute-paths.txt ({{[^)]*}})
1111
# CHECK: echo hello
1212
# CHECK: # executed command: echo '%{readfile:[[TEMP_PATH]]{{[\\\/]}}absolute-paths.txt.tmp}'
1313

14+
# CHECK-LABEL: FAIL: shtest-readfile :: env.txt ({{[^)]*}})
15+
# CHECK: env TEST=hello {{.*}} -c "import os; print(os.environ['TEST'])"
16+
# CHECK: # | hello
17+
1418
# CHECK-LABEL: FAIL: shtest-readfile :: file-does-not-exist.txt ({{[^)]*}})
1519
# CHECK: # executed command: @echo 'echo %{readfile:/file/does/not/exist}'
1620
# CHECK: # | File specified in readfile substitution does not exist: {{.*}}/file/does/not/exist

0 commit comments

Comments
 (0)