[PATCH] D98395: [lld-macho] Avoid requiring shell in tests

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 10 23:02:18 PST 2021


int3 created this revision.
int3 added a reviewer: lld-macho.
Herald added a project: lld-macho.
int3 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

There are 3 remaining tests that still have `REQUIRE: shell`:

- color-diagnostics.test -- seems necessary for ANSI escape sequence support
- stabs.s -- the shell part could be removed, but I don't think we can support the test on Windows anyway due to its reliance on `touch` to set the modtime
- framework.s -- uses symlinks, I'm not sure this works on Windows

Addresses PR49512.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98395

Files:
  lld/test/MachO/arm64-relocs.s
  lld/test/MachO/dylink-lazy.s
  lld/test/MachO/function-starts.s
  lld/test/MachO/segments.s


Index: lld/test/MachO/segments.s
===================================================================
--- lld/test/MachO/segments.s
+++ lld/test/MachO/segments.s
@@ -1,7 +1,10 @@
-# REQUIRES: x86, shell
+# REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
 # RUN: %lld -o %t %t.o
-# RUN: (llvm-readobj --macho-segment %t; echo "Total file size"; wc -c %t) | FileCheck %s
+# RUN: llvm-readobj --macho-segment %t > %t.out
+# RUN: echo "Total file size" >> %t.out
+# RUN: wc -c %t >> %t.out
+# RUN: FileCheck %s < %t.out
 
 ## These two segments must always be present at the start of an executable.
 # CHECK-NOT:  Segment {
Index: lld/test/MachO/function-starts.s
===================================================================
--- lld/test/MachO/function-starts.s
+++ lld/test/MachO/function-starts.s
@@ -1,11 +1,12 @@
-# REQUIRES: x86, shell
-# UNSUPPORTED: system-windows
+# REQUIRES: x86
 
 # RUN: split-file %s %t
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/basic.s -o %t.basic.o
 # RUN: %lld %t.basic.o -o %t.basic
-# RUN: (llvm-objdump --syms %t.basic; llvm-objdump --macho --function-starts %t.basic) | FileCheck %s --check-prefix=BASIC
+# RUN: llvm-objdump --syms %t.basic > %t.objdump
+# RUN: llvm-objdump --macho --function-starts %t.basic >> %t.objdump
+# RUN: FileCheck %s --check-prefix=BASIC < %t.objdump
 
 # BASIC:      SYMBOL TABLE:
 # BASIC-NEXT: [[#%x,MAIN:]] g F __TEXT,__text _main
Index: lld/test/MachO/dylink-lazy.s
===================================================================
--- lld/test/MachO/dylink-lazy.s
+++ lld/test/MachO/dylink-lazy.s
@@ -1,4 +1,4 @@
-# REQUIRES: x86, shell
+# REQUIRES: x86
 # RUN: mkdir -p %t
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %p/Inputs/libhello.s \
 # RUN:   -o %t/libhello.o
@@ -19,8 +19,9 @@
 ## symbol each entry points to. So we call objdump twice in order to get the
 ## disassembly of __text and the bind tables first, which allow us to check for
 ## matching entries in __stubs.
-# RUN: (llvm-objdump -d --no-show-raw-insn --syms --rebase --bind --lazy-bind %t/dylink-lazy; \
-# RUN:  llvm-objdump -D --no-show-raw-insn %t/dylink-lazy) | FileCheck %s
+# RUN: llvm-objdump -d --no-show-raw-insn --syms --rebase --bind --lazy-bind %t/dylink-lazy > %t/objdump
+# RUN: llvm-objdump -D --no-show-raw-insn %t/dylink-lazy >> %t/objdump
+# RUN: FileCheck %s < %t/objdump
 
 # RUN: %lld -pie -o %t/dylink-lazy-pie \
 # RUN:   -L%t -lhello -lgoodbye %t/dylink-lazy.o -lSystem
Index: lld/test/MachO/arm64-relocs.s
===================================================================
--- lld/test/MachO/arm64-relocs.s
+++ lld/test/MachO/arm64-relocs.s
@@ -1,7 +1,9 @@
-# REQUIRES: aarch64, shell
+# REQUIRES: aarch64
 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t.o
 # RUN: %lld -dylib -arch arm64 -lSystem -o %t %t.o
-# RUN: (llvm-objdump --syms %t; llvm-objdump --macho -d --section=__const %t) | FileCheck %s
+# RUN: llvm-objdump --syms %t > %t.objdump
+# RUN: llvm-objdump --macho -d --section=__const %t >> %t.objdump
+# RUN: FileCheck %s < %t.objdump
 
 # CHECK-LABEL: SYMBOL TABLE:
 # CHECK-DAG:   [[#%x,PTR_1:]] l     O __DATA_CONST,__const _ptr_1


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98395.329853.patch
Type: text/x-patch
Size: 3205 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210311/0592dd34/attachment.bin>


More information about the llvm-commits mailing list