1 ## Show that yaml2obj supports custom section data for Mach-O YAML inputs.
3 ## Case 1: The size of content is greater than the section size.
4 # RUN: not yaml2obj --docnum=1 %s -o %t1 2>&1 | FileCheck %s --check-prefix=CASE1
5 # CASE1: error: Section size must be greater than or equal to the content size
11 cpusubtype: 0x00000003
32 addr: 0x0000000000000000
44 ## Case 2: The content size equals the section size.
45 # RUN: yaml2obj --docnum=2 %s > %t2
46 # RUN: llvm-readobj --sections --section-data %t2 | FileCheck %s --check-prefix=CASE2
48 # CASE2-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
49 # CASE2-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
50 # CASE2-NEXT: Address: 0x0
51 # CASE2-NEXT: Size: 0x4
52 # CASE2-NEXT: Offset: 392
53 # CASE2-NEXT: Alignment: 2
54 # CASE2-NEXT: RelocationOffset: 0x0
55 # CASE2-NEXT: RelocationCount: 0
56 # CASE2-NEXT: Type: Regular (0x0)
57 # CASE2-NEXT: Attributes [ (0x0)
59 # CASE2-NEXT: Reserved1: 0x0
60 # CASE2-NEXT: Reserved2: 0x0
61 # CASE2-NEXT: Reserved3: 0x0
62 # CASE2-NEXT: SectionData (
63 # CASE2-NEXT: 0000: CDAB3412 |..4.|
70 cpusubtype: 0x00000003
91 addr: 0x0000000000000000
100 reserved3: 0x00000000
103 ## Case 3: The content size is less than the section size. In this case, the area
104 ## after the custom content is filled with zeroes.
105 # RUN: yaml2obj --docnum=3 %s > %t3
106 # RUN: llvm-readobj --sections --section-data %t3 | FileCheck %s --check-prefix=CASE3
108 # CASE3-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
109 # CASE3-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
110 # CASE3-NEXT: Address: 0x0
111 # CASE3-NEXT: Size: 0x4
112 # CASE3-NEXT: Offset: 392
113 # CASE3-NEXT: Alignment: 2
114 # CASE3-NEXT: RelocationOffset: 0x0
115 # CASE3-NEXT: RelocationCount: 0
116 # CASE3-NEXT: Type: Regular (0x0)
117 # CASE3-NEXT: Attributes [ (0x0)
119 # CASE3-NEXT: Reserved1: 0x0
120 # CASE3-NEXT: Reserved2: 0x0
121 # CASE3-NEXT: Reserved3: 0x0
122 # CASE3-NEXT: SectionData (
123 # CASE3-NEXT: 0000: AA000000 |....|
130 cpusubtype: 0x00000003
151 addr: 0x0000000000000000
158 reserved1: 0x00000000
159 reserved2: 0x00000000
160 reserved3: 0x00000000