[PATCH] D112583: [test][objcopy] Replace GNU sed extension with BSD compatible syntax.

Daniel Rodríguez Troitiño via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 26 17:37:11 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG911be05743eb: [test][objcopy] Replace GNU sed extension with BSD compatible syntax. (authored by drodriguez).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112583/new/

https://reviews.llvm.org/D112583

Files:
  llvm/test/tools/llvm-objcopy/MachO/code_signature_lc.test


Index: llvm/test/tools/llvm-objcopy/MachO/code_signature_lc.test
===================================================================
--- llvm/test/tools/llvm-objcopy/MachO/code_signature_lc.test
+++ llvm/test/tools/llvm-objcopy/MachO/code_signature_lc.test
@@ -13,24 +13,26 @@
 # RUN: obj2yaml %t.copy > %t.copy.yaml
 
 ## Verify that the copy still includes the load command
-# RUN: cat %t.copy.yaml | FileCheck %s --check-prefix=CHECK-COPY
+# RUN: FileCheck %s --check-prefix=CHECK-COPY < %t.copy.yaml
 # CHECK-COPY:      - cmd:             LC_CODE_SIGNATURE
 # CHECK-COPY-NEXT:   cmdsize:         16
 # CHECK-COPY-NEXT:   dataoff:         16544
 # CHECK-COPY-NEXT:   datasize:        304
 
 ## Remove information changed by regeneration of load command:
-## - __LINKEDIT segment filesize may change
-## - LC_CODE_SIGNATURE command dataoff and datasize may change
+## - __LINKEDIT segment filesize may change (4 lines)
+## - LC_CODE_SIGNATURE command dataoff and datasize may change (3 lines)
 ## - __LINKEDIT data locations may change
+## NOTE: The {N;N;N;N;d} means delete the next four lines for BSD and GNU sed.
+##       The ,+4d is a GNU extension which seems not to work in macOS 10.15
 
-# RUN: sed -e '/__LINKEDIT/,+4d' \
-# RUN:     -e '/LC_CODE_SIGNATURE/,+3d' \ 
+# RUN: sed -e '/__LINKEDIT/{N;N;N;N;d;}' \
+# RUN:     -e '/LC_CODE_SIGNATURE/{N;N;N;d}' \
 # RUN:     -e '/n_strx/d' \ 
 # RUN:     -e '/dyld_stub_binder/d' %t.yaml > %t.clean.yaml
 
-# RUN: sed -e '/__LINKEDIT/,+4d' \
-# RUN:     -e '/LC_CODE_SIGNATURE/,+3d' \ 
+# RUN: sed -e '/__LINKEDIT/{N;N;N;N;d;}' \
+# RUN:     -e '/LC_CODE_SIGNATURE/{N;N;N;d;}' \
 # RUN:     -e '/n_strx/d' \ 
 # RUN:     -e '/dyld_stub_binder/d' %t.copy.yaml > %t.copy.clean.yaml
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112583.382492.patch
Type: text/x-patch
Size: 1738 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211027/16e7c6a0/attachment.bin>


More information about the llvm-commits mailing list