1## Show that llvm-sizes works correctly on a typical ELF input for Berkeley 2## format. It also shows that the formatting is correct (including using tabs as 3## field separators). 4 5# RUN: yaml2obj %s -o %t.o 6 7# RUN: llvm-size -B %t.o \ 8# RUN: | FileCheck %s --match-full-lines --strict-whitespace -DFILE=%t.o --implicit-check-not={{.}} 9# RUN: llvm-size --format=berkeley %t.o \ 10# RUN: | FileCheck %s --match-full-lines --strict-whitespace -DFILE=%t.o --implicit-check-not={{.}} 11 12## Also show that the default output format is Berkeley. 13# RUN: llvm-size %t.o \ 14# RUN: | FileCheck %s --match-full-lines --strict-whitespace -DFILE=%t.o --implicit-check-not={{.}} 15 16## text is .text, .eh_frame, .unusual_name_for_code: 2 + 4 + 64 = 70 17## data is .data, .init_array, .moar_stuff: 8 + 32 + 128 = 168 18## bss is .bss: 1 19## total: 239 20## unaccounted for (not affecting total) is .debug_info, .text.but_not_really 21# CHECK: text data bss dec hex filename 22# CHECK-NEXT: 70 168 1 239 ef [[FILE]] 23 24!ELF 25FileHeader: 26 Class: ELFCLASS64 27 Data: ELFDATA2LSB 28 Type: ET_EXEC 29 Machine: EM_X86_64 30Sections: 31 - Name: .bss 32 Type: SHT_NOBITS 33 Flags: [ SHF_ALLOC, SHF_WRITE ] 34 Size: 1 35 - Name: .text 36 Type: SHT_PROGBITS 37 Flags: [ SHF_ALLOC, SHF_EXECINSTR ] 38 Size: 2 39 - Name: .unusual_name_for_code 40 Type: SHT_PROGBITS 41 Flags: [ SHF_ALLOC, SHF_EXECINSTR ] 42 Size: 64 43 - Name: .eh_frame 44 Type: SHT_PROGBITS 45 Flags: [ SHF_ALLOC ] 46 Size: 4 47 - Name: .data 48 Type: SHT_PROGBITS 49 Flags: [ SHF_ALLOC, SHF_WRITE ] 50 Size: 8 51 - Name: .moar_stuff 52 Type: SHT_PROGBITS 53 Flags: [ SHF_ALLOC, SHF_WRITE ] 54 Size: 128 55 - Name: .text.but_not_really 56 Type: SHT_PROGBITS 57 Flags: [ ] 58 Size: 256 59 - Name: .debug_info 60 Type: SHT_PROGBITS 61 Flags: [ ] 62 Size: 16 63 - Name: .init_array 64 Type: SHT_INIT_ARRAY 65 Flags: [ SHF_ALLOC, SHF_WRITE ] 66 Size: 32 67