|
1 |
| -# REQUIRES: x86 |
| 1 | +# REQUIRES: x86,aarch64 |
| 2 | +## 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-windows |
| 4 | + |
2 | 5 | # RUN: llvm-mc -filetype=obj -triple=i386-apple-darwin %s -o %t.i386.o
|
3 | 6 | # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.x86_64.o
|
| 7 | +# RUN: llvm-mc -filetype=obj -triple=arm64-apple-macos11.0 %s -o %t.arm64.o |
| 8 | + |
4 | 9 | # RUN: llvm-lipo %t.i386.o %t.x86_64.o -create -o %t.fat.o
|
5 | 10 | # RUN: %lld -o /dev/null %t.fat.o
|
6 |
| - |
7 | 11 | # RUN: llvm-lipo %t.i386.o -create -o %t.noarch.o
|
8 | 12 | # RUN: not %lld -o /dev/null %t.noarch.o 2>&1 | \
|
9 | 13 | # RUN: FileCheck %s -DFILE=%t.noarch.o
|
10 | 14 | # CHECK: error: unable to find matching architecture in [[FILE]]
|
11 | 15 |
|
| 16 | +## Validates that we read the cpu-subtype correctly from a fat exec. |
| 17 | +# RUN: %lld -o %t.x86_64.out %t.x86_64.o |
| 18 | +# RUN: %lld -arch arm64 -o %t.arm64.out %t.arm64.o |
| 19 | +# RUN: llvm-lipo %t.x86_64.out %t.arm64.out -create -o %t.fat.exec.out |
| 20 | +# RUN: %lld %t.x86_64.o -bundle_loader %t.fat.exec.out -bundle -o %t.fat.bundle |
| 21 | + |
| 22 | +# RUN: llvm-otool -h %t.fat.bundle -f %t.fat.exec.out | FileCheck %s --check-prefix=CPU-SUB |
| 23 | +# CPU-SUB: Fat headers |
| 24 | +# CPU-SUB: nfat_arch 2 |
| 25 | +# CPU-SUB: architecture 0 |
| 26 | +# CPU-SUB-NEXT: cputype 16777223 |
| 27 | +# CPU-SUB-NEXT: cpusubtype 3 |
| 28 | +# CPU-SUB: architecture 1 |
| 29 | +# CPU-SUB-NEXT: cputype 16777228 |
| 30 | +# CPU-SUB-NEXT: cpusubtype 0 |
| 31 | + |
| 32 | +# CPU-SUB: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags |
| 33 | +# CPU-SUB-NEXT: 0xfeedfacf 16777223 3 0x{{.+}} {{.+}} {{.+}} {{.+}} {{.+}} |
| 34 | + |
12 | 35 | .text
|
13 | 36 | .global _main
|
14 | 37 | _main:
|
15 |
| - mov $0, %eax |
16 | 38 | ret
|
0 commit comments