[PATCH] D140987: [lld-macho][nfc] Re-enable previously disabled test.

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 4 06:51:03 PST 2023


oontvoo created this revision.
Herald added subscribers: pengfei, kristof.beyls.
Herald added projects: lld-macho, All.
Herald added a reviewer: lld-macho.
oontvoo requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This check was previous disabled because the test kept failing on ARM64. The output from reported failure message
gave the impression that the bundle was created as an x86-64 bundle but upon further inspection, I believe that's
a bug in llvm-otool where it prints both -h and -f for both input files on ARM64.

So the "fix" here is to rewrite the test to run the two otool commands separately but concatenate the
output into one file for checking.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140987

Files:
  lld/test/MachO/fat-arch.s


Index: lld/test/MachO/fat-arch.s
===================================================================
--- lld/test/MachO/fat-arch.s
+++ lld/test/MachO/fat-arch.s
@@ -19,9 +19,13 @@
 # RUN: llvm-lipo %t.x86_64.out %t.arm64.out -create -o %t.fat.exec.out
 # RUN: %lld -arch x86_64 %t.x86_64.o -bundle_loader %t.fat.exec.out -bundle -o %t.fat.bundle
 
-## FIXME: Re-enable this test, which is failing on arm64, once we figured out why
-## %t.fat.bundle is produced as an arm64.
-# RUN llvm-otool -h %t.fat.bundle -f %t.fat.exec.out | FileCheck %s --check-prefix=CPU-SUB
+# RUN: llvm-otool -h %t.fat.bundle > %t.bundle_header.txt
+# RUN: llvm-otool -f %t.fat.exec.out >> %t.bundle_header.txt
+# RUN: cat %t.bundle_header.txt | FileCheck %s --check-prefix=CPU-SUB
+
+# CPU-SUB:            magic     cputype      cpusubtype   caps      filetype   ncmds sizeofcmds      flags
+# CPU-SUB-NEXT:  0xfeedfacf     16777223              3  0x{{.+}}    {{.+}}  {{.+}}    {{.+}}      {{.+}}
+	
 # CPU-SUB: Fat headers
 # CPU-SUB: nfat_arch 2
 # CPU-SUB: architecture 0
@@ -31,9 +35,6 @@
 # CPU-SUB-NEXT:    cputype 16777228
 # CPU-SUB-NEXT:    cpusubtype 0
 
-# CPU-SUB:            magic     cputype      cpusubtype   caps      filetype   ncmds sizeofcmds      flags
-# CPU-SUB-NEXT:  0xfeedfacf     16777223              3  0x{{.+}}    {{.+}}  {{.+}}    {{.+}}      {{.+}}
-
 .text
 .global _main
 _main:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140987.486271.patch
Type: text/x-patch
Size: 1390 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230104/ba50d374/attachment.bin>


More information about the llvm-commits mailing list