Recommit "rL366894: [yaml2obj] - Allow custom fields for the SHT_UNDEF sections."
[llvm-complete.git] / test / tools / llvm-size / X86 / elf-sizes.test
blobcb7fcd3a8851080aaf16d9d1780020fa7b753f1e
1 # RUN: yaml2obj %s > %t.o
2 # RUN: llvm-size -B %t.o | FileCheck %s
4 !ELF
5 FileHeader:
6   Class:           ELFCLASS64
7   Data:            ELFDATA2LSB
8   Type:            ET_EXEC
9   Machine:         EM_X86_64
10 Sections:
11   - Name:            .bss
12     Type:            SHT_NOBITS
13     Flags:           [ SHF_ALLOC, SHF_WRITE ]
14     Size:            1
15   - Name:            .text
16     Type:            SHT_PROGBITS
17     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
18     Size:            2
19   - Name:            .unusual_name_for_code
20     Type:            SHT_PROGBITS
21     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
22     Size:            64
23   - Name:            .eh_frame
24     Type:            SHT_PROGBITS
25     Flags:           [ SHF_ALLOC ]
26     Size:            4
27   - Name:            .data
28     Type:            SHT_PROGBITS
29     Flags:           [ SHF_ALLOC, SHF_WRITE ]
30     Size:            8
31   - Name:            .moar_stuff
32     Type:            SHT_PROGBITS
33     Flags:           [ SHF_ALLOC, SHF_WRITE ]
34     Size:            128
35   - Name:            .text.but_not_really
36     Type:            SHT_PROGBITS
37     Flags:           [ ]
38     Size:            256
39   - Name:            .debug_info
40     Type:            SHT_PROGBITS
41     Flags:           [ ]
42     Size:            16
43   - Name:            .init_array
44     Type:            SHT_INIT_ARRAY
45     Flags:           [ SHF_ALLOC, SHF_WRITE ]
46     Size:            32
48 # text is .text, .eh_frame, .unusual_name_for_code: 2 + 4 + 64 = 70
49 # data is .data, .init_array, .moar_stuff: 8 + 32 + 128 = 168
50 # bss is .bss: 1
51 # total: 239
52 # unaccounted for (not affecting total) is .debug_info, .text.but_not_really
54 # CHECK: text data bss dec
55 # CHECK: 70   168  1   239