1 ## Check we are able to describe the content of a section
2 ## using the ContentArray key.
4 ## Check we are able to use ContentArray to create multi-line descriptions
5 ## of section contents with comments on the same line.
6 # RUN: yaml2obj --docnum=1 %s -o %t1
7 # RUN: llvm-readobj --sections --section-data %t1 | FileCheck %s
11 # CHECK-NEXT: Name: .foo
12 # CHECK-NEXT: Type: SHT_PROGBITS
15 # CHECK-NEXT: Address: 0x0
16 # CHECK-NEXT: Offset: 0x40
17 # CHECK-NEXT: Size: 16
20 # CHECK-NEXT: AddressAlignment: 0
21 # CHECK-NEXT: EntrySize: 0
22 # CHECK-NEXT: SectionData (
23 # CHECK-NEXT: 0000: 11223344 55667788 99AABBCC DDEEFF00
35 ContentArray: [ 0x11, 0x22, 0x33, 0x44, ## .long 11223344
36 0x55, 0x66, ## .short 5566.
38 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00 ] ## .quad 0x8899aabbccddeeff00
40 ## Check we do not allow using 'Content' and 'ContentArray' at the same time.
41 # RUN: not yaml2obj --docnum=2 %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=BOTH
42 # BOTH: error: Content and ContentArray can't be used together
55 ## Check how the "Size" and the "ContentArray" keys can be used together.
57 ## Case A: check that we report an error when the the value of "Size" is less than the content size.
58 # RUN: not yaml2obj --docnum=3 -DSIZE=1 %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=SIZE-LESS
59 # SIZE-LESS: error: Section size must be greater than or equal to the content size
69 ContentArray: [ 0x11, 0x22 ]
72 ## Case B: check we are able to produce an output when the value of "Size" is equal
73 ## to the content size. In this case the "Size" key has no effect.
74 # RUN: yaml2obj --docnum=3 -DSIZE=2 %s -o %t3.eq
75 # RUN: llvm-readobj --sections --section-data %t3.eq | FileCheck %s --check-prefix=SIZE-EQ
78 # SIZE-EQ: SectionData (
79 # SIZE-EQ-NEXT: 0000: 1122 |
82 ## Case C: check we are able to produce an output when the value of "Size" is greater
83 ## than the content size. In this case zeroes are added as padding after the
85 # RUN: yaml2obj --docnum=3 -DSIZE=3 %s -o %t4.gr
86 # RUN: llvm-readobj --sections --section-data %t4.gr | FileCheck %s --check-prefix=SIZE-GR
89 # SIZE-GR: SectionData (
90 # SIZE-GR-NEXT: 0000: 112200 |