46 lines · plain
1# REQUIRES: x86,aarch642## FIXME: The tests doesn't run on windows right now because of llvm-mc (can't produce triple=arm64-apple-macos11.0)3# UNSUPPORTED: system-windows4 5# RUN: llvm-mc -filetype=obj -triple=i386-apple-darwin %s -o %t.i386.o6# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.x86_64.o7# RUN: llvm-mc -filetype=obj -triple=arm64-apple-macos11.0 %s -o %t.arm64.o8 9# RUN: llvm-lipo %t.i386.o %t.x86_64.o -create -o %t.fat.o10# RUN: %lld -o /dev/null %t.fat.o11# RUN: llvm-lipo %t.i386.o -create -o %t.noarch.o12# RUN: not %no-fatal-warnings-lld -o /dev/null %t.noarch.o 2>&1 | \13# RUN: FileCheck %s -DFILE=%t.noarch.o14# CHECK: warning: [[FILE]]: ignoring file because it is universal (i386) but does not contain the x86_64 architecture15 16# RUN: not %lld -arch arm64 -o /dev/null %t.fat.o 2>&1 | \17# RUN: FileCheck --check-prefix=CHECK-FAT %s -DFILE=%t.fat.o18# CHECK-FAT: error: [[FILE]]: ignoring file because it is universal (i386,x86_64) but does not contain the arm64 architecture19 20## Validates that we read the cpu-subtype correctly from a fat exec.21# RUN: %lld -o %t.x86_64.out %t.x86_64.o22# RUN: %lld -arch arm64 -o %t.arm64.out %t.arm64.o23# RUN: llvm-lipo %t.x86_64.out %t.arm64.out -create -o %t.fat.exec.out24# RUN: %lld -arch x86_64 %t.x86_64.o -bundle_loader %t.fat.exec.out -bundle -o %t.fat.bundle25 26# RUN: llvm-otool -h %t.fat.bundle > %t.bundle_header.txt27# RUN: llvm-otool -f %t.fat.exec.out >> %t.bundle_header.txt28# RUN: cat %t.bundle_header.txt | FileCheck %s --check-prefix=CPU-SUB29 30# CPU-SUB: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags31# CPU-SUB-NEXT: 0xfeedfacf 16777223 3 0x{{.+}} {{.+}} {{.+}} {{.+}} {{.+}}32 33# CPU-SUB: Fat headers34# CPU-SUB: nfat_arch 235# CPU-SUB: architecture 036# CPU-SUB-NEXT: cputype 1677722337# CPU-SUB-NEXT: cpusubtype 338# CPU-SUB: architecture 139# CPU-SUB-NEXT: cputype 1677722840# CPU-SUB-NEXT: cpusubtype 041 42.text43.global _main44_main:45 ret46