1 ## This file contains test cases for generating Fat Mach-O binaries.
3 ## a) Test that yaml2obj emits Fat Mach-O binary and obj2yaml converts it
6 # RUN: yaml2obj --docnum=1 %s | obj2yaml | FileCheck %s
14 cpusubtype: 0x00000003
15 offset: 0x0000000000001000
19 cpusubtype: 0x80000003
20 offset: 0x0000000000005000
27 cpusubtype: 0x00000003
35 cpusubtype: 0x80000003
44 #CHECK: --- !fat-mach-o
46 #CHECK: magic: 0xCAFEBABE
49 #CHECK: - cputype: 0x7
50 #CHECK: cpusubtype: 0x3
51 #CHECK: offset: 0x1000
54 #CHECK: - cputype: 0x1000007
55 #CHECK: cpusubtype: 0x80000003
56 #CHECK: offset: 0x5000
62 #CHECK: magic: 0xFEEDFACE
64 #CHECK: cpusubtype: 0x3
68 #CHECK: flags: 0x1218085
71 #CHECK: magic: 0xFEEDFACF
72 #CHECK: cputype: 0x1000007
73 #CHECK: cpusubtype: 0x80000003
77 #CHECK: flags: 0x218085
81 ## b) Test that yaml2obj emits an error message if the number of 'FatArchs' is less than
82 ## the number of 'Slices'.
84 # RUN: not yaml2obj --docnum=2 %s -o %t2.fat-macho 2>&1 | FileCheck %s --check-prefix=ERROR
86 # ERROR: yaml2obj: error: cannot write 'Slices' if not described in 'FatArches'
93 ## 2 FatArchs are expected.
95 cpusubtype: 0x00000003
96 offset: 0x0000000000001000
103 cpusubtype: 0x00000003
111 cpusubtype: 0x00000003