205 lines · plain
1# RUN: yaml2obj %s -o %t1.o2# RUN: yaml2obj %s -o %t2.o3 4# RUN: printf "\004" > %t.stats5 6# RUN: printf "%%s" "%t1.o" >> %t.stats7# RUN: printf "\000" >> %t.stats8# RUN: printf "\001\000\000\000\001\000\000\000" >> %t.stats9# RUN: printf "\021\000\000\000\002\000\000\040" >> %t.stats10# RUN: printf "\041\000\000\000\003\000\000\100" >> %t.stats11# RUN: printf "\001\000\000\000\004\000\000\140" >> %t.stats12# RUN: printf "\021\000\000\000\005\000\000\200" >> %t.stats13# RUN: printf "\041\000\000\000\006\000\000\240" >> %t.stats14# RUN: printf "\000\000\000\000\000\000\000\000" >> %t.stats15 16# RUN: printf "%%s" "%t2.o" >> %t.stats17# RUN: printf "\000" >> %t.stats18# RUN: printf "\041\000\000\000\007\000\000\000" >> %t.stats19# RUN: printf "\021\000\000\000\010\000\000\040" >> %t.stats20# RUN: printf "\001\000\000\000\011\000\000\100" >> %t.stats21# RUN: printf "\041\000\000\000\013\000\000\140" >> %t.stats22# RUN: printf "\021\000\000\000\014\000\000\200" >> %t.stats23# RUN: printf "\001\000\000\000\016\000\000\240" >> %t.stats24# RUN: printf "\000\000\000\000\000\000\000\000" >> %t.stats25 26# RUN: sanstats %t.stats | FileCheck %s27 28# Test that if binaries are not in the original location then sanstats29# searches them next to the stats file.30# RUN: mkdir -p %t.dir31# RUN: mv -f %t1.o %t2.o %t.dir32# RUN: sanstats %t.stats | FileCheck %s --check-prefix=INVALID33# RUN: mv -f %t.stats %t.dir/copy.stats34# RUN: cd %t.dir && sanstats copy.stats | FileCheck %s35 36# INVALID: <invalid>37# CHECK-NOT: <invalid>38# CHECK: 0x0000000000000000 /tmp{{[/\\]}}f.c:1 f1 cfi-vcall 139# CHECK: 0x0000000000000010 /tmp{{[/\\]}}f.c:2 f2 cfi-nvcall 240# CHECK: 0x0000000000000020 /tmp{{[/\\]}}f.c:3 f3 cfi-derived-cast 341# CHECK: 0x0000000000000000 /tmp{{[/\\]}}f.c:1 f1 cfi-unrelated-cast 442# CHECK: 0x0000000000000010 /tmp{{[/\\]}}f.c:2 f2 cfi-icall 543# CHECK: 0x0000000000000020 /tmp{{[/\\]}}f.c:3 f3 <unknown> 644 45# CHECK: 0x0000000000000020 /tmp{{[/\\]}}f.c:3 f3 cfi-vcall 746# CHECK: 0x0000000000000010 /tmp{{[/\\]}}f.c:2 f2 cfi-nvcall 847# CHECK: 0x0000000000000000 /tmp{{[/\\]}}f.c:1 f1 cfi-derived-cast 948# CHECK: 0x0000000000000020 /tmp{{[/\\]}}f.c:3 f3 cfi-unrelated-cast 1149# CHECK: 0x0000000000000010 /tmp{{[/\\]}}f.c:2 f2 cfi-icall 1250# CHECK: 0x0000000000000000 /tmp{{[/\\]}}f.c:1 f1 <unknown> 1451 52--- !ELF53FileHeader: 54 Class: ELFCLASS6455 Data: ELFDATA2LSB56 Type: ET_REL57 Machine: EM_X86_6458Sections: 59 - Name: .text60 Type: SHT_PROGBITS61 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]62 AddressAlign: 0x000000000000001063 Content: 554889E55DC3662E0F1F840000000000554889E55DC3662E0F1F840000000000554889E55DC364 - Name: .debug_str65 Type: SHT_PROGBITS66 Flags: [ SHF_MERGE, SHF_STRINGS ]67 AddressAlign: 0x000000000000000168 Content: 636C616E672076657273696F6E20332E382E3020287472756E6B203235353339332920286C6C766D2F7472756E6B203235353734352900662E63002F746D700066310066320066330069 - Name: .debug_loc70 Type: SHT_PROGBITS71 AddressAlign: 0x000000000000000172 Content: ''73 - Name: .debug_abbrev74 Type: SHT_PROGBITS75 AddressAlign: 0x000000000000000176 Content: 011101250E1305030E10171B0E110112060000022E00110112064018030E3A0B3B0B3F1900000077 - Name: .debug_info78 Type: SHT_PROGBITS79 AddressAlign: 0x000000000000000180 Content: 660000000400000000000801000000000C000000000000000000000000000000000000000000260000000200000000000000000600000001560000000001010200000000000000000600000001560000000001020200000000000000000600000001560000000001030081 - Name: .rela.debug_info82 Type: SHT_RELA83 Link: .symtab84 AddressAlign: 0x000000000000000885 Info: .debug_info86 Relocations: 87 - Offset: 0x000000000000000688 Type: R_X86_64_3289 - Offset: 0x000000000000000C90 Type: R_X86_64_3291 - Offset: 0x000000000000001292 Type: R_X86_64_3293 Addend: 5594 - Offset: 0x000000000000001695 Type: R_X86_64_3296 - Offset: 0x000000000000001A97 Type: R_X86_64_3298 Addend: 5999 - Offset: 0x000000000000001E100 Type: R_X86_64_64101 - Offset: 0x000000000000002B102 Type: R_X86_64_64103 - Offset: 0x0000000000000039104 Type: R_X86_64_32105 Addend: 64106 - Offset: 0x0000000000000040107 Type: R_X86_64_64108 Addend: 16109 - Offset: 0x000000000000004E110 Type: R_X86_64_32111 Addend: 67112 - Offset: 0x0000000000000055113 Type: R_X86_64_64114 Addend: 32115 - Offset: 0x0000000000000063116 Type: R_X86_64_32117 Addend: 70118 - Name: .debug_ranges119 Type: SHT_PROGBITS120 AddressAlign: 0x0000000000000001121 Content: ''122 - Name: .debug_pubnames123 Type: SHT_PROGBITS124 AddressAlign: 0x0000000000000001125 Content: 230000000200000000006A0000002A0000006631003F0000006632005400000066330000000000126 - Name: .rela.debug_pubnames127 Type: SHT_RELA128 Link: .symtab129 AddressAlign: 0x0000000000000008130 Info: .debug_pubnames131 Relocations: 132 - Offset: 0x0000000000000006133 Type: R_X86_64_32134 - Name: .comment135 Type: SHT_PROGBITS136 Flags: [ SHF_MERGE, SHF_STRINGS ]137 AddressAlign: 0x0000000000000001138 Content: 00636C616E672076657273696F6E20332E382E3020287472756E6B203235353339332920286C6C766D2F7472756E6B203235353734352900139 - Name: .note.GNU-stack140 Type: SHT_PROGBITS141 AddressAlign: 0x0000000000000001142 Content: ''143 - Name: .eh_frame144 Type: SHT_X86_64_UNWIND145 Flags: [ SHF_ALLOC ]146 AddressAlign: 0x0000000000000008147 Content: 1400000000000000017A5200017810011B0C070890010000180000001C000000000000000600000000410E108602430D060000001800000038000000000000000600000000410E108602430D060000001C00000054000000000000000600000000410E108602430D0600000000000000148 - Name: .rela.eh_frame149 Type: SHT_RELA150 Link: .symtab151 AddressAlign: 0x0000000000000008152 Info: .eh_frame153 Relocations: 154 - Offset: 0x0000000000000020155 Type: R_X86_64_PC32156 - Offset: 0x000000000000003C157 Type: R_X86_64_PC32158 Addend: 16159 - Offset: 0x0000000000000058160 Type: R_X86_64_PC32161 Addend: 32162 - Name: .debug_line163 Type: SHT_PROGBITS164 AddressAlign: 0x0000000000000001165 Content: 4300000002001A0000000101FB0E0D00010101010000000100000100662E630000000000000902000000000000000001050C0A4A0500BB050C0A4A0500BB050C0A4A0202000101166 - Name: .rela.debug_line167 Type: SHT_RELA168 Link: .symtab169 AddressAlign: 0x0000000000000008170 Info: .debug_line171 Relocations: 172 - Offset: 0x0000000000000027173 Type: R_X86_64_64174Symbols:175 - Name: f.c176 Type: STT_FILE177 - Type: STT_SECTION178 Section: .text179 - Type: STT_SECTION180 Section: .debug_str181 - Type: STT_SECTION182 Section: .debug_abbrev183 - Type: STT_SECTION184 Section: .debug_info185 - Type: STT_SECTION186 Section: .debug_line187 - Name: f1188 Type: STT_FUNC189 Section: .text190 Size: 0x0000000000000006191 Binding: STB_GLOBAL192 - Name: f2193 Type: STT_FUNC194 Section: .text195 Value: 0x0000000000000010196 Size: 0x0000000000000006197 Binding: STB_GLOBAL198 - Name: f3199 Type: STT_FUNC200 Section: .text201 Value: 0x0000000000000020202 Size: 0x0000000000000006203 Binding: STB_GLOBAL204...205