[llvm-bugs] [Bug 49512] New: lld/test/MachO tests should require shell less

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 10 06:33:43 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=49512

            Bug ID: 49512
           Summary: lld/test/MachO tests should require shell less
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: MachO
          Assignee: unassignedbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: gkm at fb.com, jezreel at gmail.com,
                    llvm-bugs at lists.llvm.org, smeenai at fb.com

LLVM is a cross-platform project, and tests should run on all platforms as much
as possible. People should be able to hack on lld/MachO on Windows if they so
choose.

Despite lld/MachO being the youngest lld port, it already has the most tests
that require shell:

thakis at MBP llvm-project % rg -l shell lld/test/COFF | wc -l
       3
thakis at MBP llvm-project % rg -l shell lld/test/ELF | wc -l
       5
thakis at MBP llvm-project % rg -l shell lld/test/MachO | wc -l
       7


This is a bad pattern and we should stop it. It looks almost all of these are
due to this pattern:

# RUN: (llvm-objdump --syms %t.basic; llvm-objdump --macho --function-starts
%t.basic) | FileCheck %s --check-prefix=BASIC


Instead, we probably just:

# RUN: llvm-objdump --syms %t.basic > %t-objdump.txt
# RUN: llvm-objdump --macho --function-starts %t.basic >> %t-objdump.txt
# RUN: FileCheck %s --check-prefix=BASIC < %t-objdump.txt

That's marginally longer, but it's easy to understand. Alternatively, maybe we
could change llvm-objdump to be able to dump both symbols and something else
but dump symbols first."Slightly longer but easy to understand" seems like a
good option to me though :)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210310/5830adab/attachment.html>


More information about the llvm-bugs mailing list