From e9c82423939742ba85c497f16dcac6a547534b67 Mon Sep 17 00:00:00 2001 From: Vy Nguyen Date: Wed, 4 Jan 2023 09:43:34 -0500 Subject: [PATCH] [lld-macho][nfc] Re-enable previously disabled test. 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. Differential Revision: https://reviews.llvm.org/D140987 --- lld/test/MachO/fat-arch.s | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lld/test/MachO/fat-arch.s b/lld/test/MachO/fat-arch.s index 5609ee5..7ccf8b6 100644 --- a/lld/test/MachO/fat-arch.s +++ b/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: -- 2.7.4