1 ## Check how obj2yaml produces SHT_LLVM_LINKER_OPTIONS section descriptions.
3 ## Check we dump valid sections using pairs of "Name" and "Value" strings.
5 # RUN: yaml2obj --docnum=1 %s -o %t1
6 # RUN: obj2yaml %t1 | FileCheck %s --check-prefix=VALID
8 # VALID: - Name: .linker-options-valid1
9 # VALID-NEXT: Type: SHT_LLVM_LINKER_OPTIONS
10 # VALID-NEXT: Options:
11 # VALID-NEXT: - Name: a
12 # VALID-NEXT: Value: b
13 # VALID-NEXT: - Name: .linker-options-valid2
14 # VALID-NEXT: Type: SHT_LLVM_LINKER_OPTIONS
15 # VALID-NEXT: Options:
16 # VALID-NEXT: - Name: a
17 # VALID-NEXT: Value: b
18 # VALID-NEXT: - Name: c
19 # VALID-NEXT: Value: d
27 - Name: .linker-options-valid1
28 Type: SHT_LLVM_LINKER_OPTIONS
30 - Name: .linker-options-valid2
31 Type: SHT_LLVM_LINKER_OPTIONS
32 Content: "6100620063006400"
34 ## Check we dump corrupt sections using the "Content" key.
36 # RUN: yaml2obj --docnum=2 %s -o %t2
37 # RUN: obj2yaml %t2 | FileCheck %s --check-prefix=CORRUPT
39 # CORRUPT: - Name: .linker-options-empty
40 # CORRUPT-NEXT: Type: SHT_LLVM_LINKER_OPTIONS
41 # CORRUPT-NEXT: Content: ''
42 # CORRUPT-NEXT: - Name: .linker-options-no-null
43 # CORRUPT-NEXT: Type: SHT_LLVM_LINKER_OPTIONS
44 # CORRUPT-NEXT: Content: '610062'
45 # CORRUPT-NEXT: - Name: .linker-options-incomplete
46 # CORRUPT-NEXT: Type: SHT_LLVM_LINKER_OPTIONS
47 # CORRUPT-NEXT: Content: '6100'
56 - Name: .linker-options-empty
57 Type: SHT_LLVM_LINKER_OPTIONS
59 ## 2) Non-null terminated content.
60 - Name: .linker-options-no-null
61 Type: SHT_LLVM_LINKER_OPTIONS
63 ## 3) Odd number of strings in the section.
64 ## (Hence it contains an incomplete key-value pair).
65 - Name: .linker-options-incomplete
66 Type: SHT_LLVM_LINKER_OPTIONS