Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / tools / obj2yaml / ELF / linker-options.yaml
blob7d8216361a1d41675999708ca999f89d9c23a03c
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
21 --- !ELF
22 FileHeader:
23   Class: ELFCLASS64
24   Data:  ELFDATA2LSB
25   Type:  ET_REL
26 Sections:
27   - Name:    .linker-options-valid1
28     Type:    SHT_LLVM_LINKER_OPTIONS
29     Content: "61006200"
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'
49 --- !ELF
50 FileHeader:
51   Class: ELFCLASS64
52   Data:  ELFDATA2LSB
53   Type:  ET_REL
54 Sections:
55 ## 1) Empty content.
56   - Name:    .linker-options-empty
57     Type:    SHT_LLVM_LINKER_OPTIONS
58     Content: ""
59 ## 2) Non-null terminated content.
60   - Name:    .linker-options-no-null
61     Type:    SHT_LLVM_LINKER_OPTIONS
62     Content: "610062"
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
67     Content: "6100"