1 ## Check how "Content", "Size" and "Entries" keys can be used to
2 ## describe a content for relocations sections.
4 ## Check we can use the "Content" key alone.
6 # RUN: yaml2obj -DCONTENT="01234567" %s -o %t1.content
7 # RUN: llvm-readobj --sections --section-data %t1.content | \
8 # RUN: FileCheck %s --check-prefix=RAW -DDATA="01234567"
14 # RAW-NEXT: 0000: [[DATA]] |
26 Content: [[CONTENT=<none>]]
28 Entries: [[ENTRIES=<none>]]
30 ## Check we can use the "Size" key alone.
32 # RUN: yaml2obj -DSIZE=3 %s -o %t1.size
33 # RUN: llvm-readobj --sections --section-data %t1.size | \
34 # RUN: FileCheck %s --check-prefix=RAW -DDATA="000000"
36 ## Check we can use the "Content" key with the "Size" key when the size is greater
37 ## than or equal to the content size.
39 # RUN: not yaml2obj -DSIZE=1 -DCONTENT="'0011'" %s 2>&1 | \
40 # RUN: FileCheck %s --check-prefix=CONTENT-SIZE-ERR
42 # CONTENT-SIZE-ERR: error: Section size must be greater than or equal to the content size
44 # RUN: yaml2obj -DSIZE=2 -DCONTENT="'0011'" %s -o %t.cont.size.eq.o
45 # RUN: llvm-readobj --sections --section-data %t.cont.size.eq.o | \
46 # RUN: FileCheck %s --check-prefix=RAW -DDATA="0011"
48 # RUN: yaml2obj -DSIZE=3 -DCONTENT="'0011'" %s -o %t.cont.size.gr.o
49 # RUN: llvm-readobj --sections --section-data %t.cont.size.gr.o | \
50 # RUN: FileCheck %s --check-prefix=RAW -DDATA="001100"
52 ## Check we can't use the "Entries" key together with the "Content" or "Size" keys.
54 # RUN: not yaml2obj -DSIZE=0 -DENTRIES="[]" %s 2>&1 | \
55 # RUN: FileCheck %s --check-prefix=ENT-ERR
56 # RUN: not yaml2obj -DCONTENT="'00'" -DENTRIES="[]" %s 2>&1 | \
57 # RUN: FileCheck %s --check-prefix=ENT-ERR
59 # ENT-ERR: error: "Entries" cannot be used with "Content" or "Size"
61 ## Check we create an empty section when none of "Size", "Content" or "Entries" are specified.
63 # RUN: yaml2obj %s -o %t.empty.o
64 # RUN: llvm-readelf --sections --section-data %t.empty.o | \
65 # RUN: FileCheck %s --check-prefix=EMPTY-SEC
67 # EMPTY-SEC: [Nr] Name Type Address Off Size
68 # EMPTY-SEC: [ 1] .dynamic DYNAMIC 0000000000000000 000040 000000