1 # RUN: yaml2obj %s > %t1.o
2 # RUN: yaml2obj %s > %t2.o
4 # RUN: printf "\x04" > %t.stats
6 # RUN: printf "%%s" "%t1.o" >> %t.stats
7 # RUN: printf "\x00" >> %t.stats
8 # RUN: printf "\x01\x00\x00\x00\x01\x00\x00\x00" >> %t.stats
9 # RUN: printf "\x11\x00\x00\x00\x02\x00\x00\x20" >> %t.stats
10 # RUN: printf "\x21\x00\x00\x00\x03\x00\x00\x40" >> %t.stats
11 # RUN: printf "\x01\x00\x00\x00\x04\x00\x00\x60" >> %t.stats
12 # RUN: printf "\x11\x00\x00\x00\x05\x00\x00\x80" >> %t.stats
13 # RUN: printf "\x21\x00\x00\x00\x06\x00\x00\xa0" >> %t.stats
14 # RUN: printf "\x00\x00\x00\x00\x00\x00\x00\x00" >> %t.stats
16 # RUN: printf "%%s" "%t2.o" >> %t.stats
17 # RUN: printf "\x00" >> %t.stats
18 # RUN: printf "\x21\x00\x00\x00\x07\x00\x00\x00" >> %t.stats
19 # RUN: printf "\x11\x00\x00\x00\x08\x00\x00\x20" >> %t.stats
20 # RUN: printf "\x01\x00\x00\x00\x09\x00\x00\x40" >> %t.stats
21 # RUN: printf "\x21\x00\x00\x00\x0b\x00\x00\x60" >> %t.stats
22 # RUN: printf "\x11\x00\x00\x00\x0c\x00\x00\x80" >> %t.stats
23 # RUN: printf "\x01\x00\x00\x00\x0e\x00\x00\xa0" >> %t.stats
24 # RUN: printf "\x00\x00\x00\x00\x00\x00\x00\x00" >> %t.stats
26 # RUN: sanstats %t.stats | FileCheck %s
28 # Test that if binaries are not in the original location then sanstats
29 # searches them next to the stats file.
30 # RUN: mkdir -p %t.dir
31 # RUN: mv -f %t1.o %t2.o %t.dir
32 # RUN: sanstats %t.stats | FileCheck %s --check-prefix=INVALID
33 # RUN: mv -f %t.stats %t.dir/copy.stats
34 # RUN: cd %t.dir && sanstats copy.stats | FileCheck %s
37 # CHECK-NOT: <invalid>
38 # CHECK: 0x0000000000000000 /tmp{{[/\\]}}f.c:1 f1 cfi-vcall 1
39 # CHECK: 0x0000000000000010 /tmp{{[/\\]}}f.c:2 f2 cfi-nvcall 2
40 # CHECK: 0x0000000000000020 /tmp{{[/\\]}}f.c:3 f3 cfi-derived-cast 3
41 # CHECK: 0x0000000000000000 /tmp{{[/\\]}}f.c:1 f1 cfi-unrelated-cast 4
42 # CHECK: 0x0000000000000010 /tmp{{[/\\]}}f.c:2 f2 cfi-icall 5
43 # CHECK: 0x0000000000000020 /tmp{{[/\\]}}f.c:3 f3 <unknown> 6
45 # CHECK: 0x0000000000000020 /tmp{{[/\\]}}f.c:3 f3 cfi-vcall 7
46 # CHECK: 0x0000000000000010 /tmp{{[/\\]}}f.c:2 f2 cfi-nvcall 8
47 # CHECK: 0x0000000000000000 /tmp{{[/\\]}}f.c:1 f1 cfi-derived-cast 9
48 # CHECK: 0x0000000000000020 /tmp{{[/\\]}}f.c:3 f3 cfi-unrelated-cast 11
49 # CHECK: 0x0000000000000010 /tmp{{[/\\]}}f.c:2 f2 cfi-icall 12
50 # CHECK: 0x0000000000000000 /tmp{{[/\\]}}f.c:1 f1 <unknown> 14
61 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
62 AddressAlign: 0x0000000000000010
63 Content: 554889E55DC3662E0F1F840000000000554889E55DC3662E0F1F840000000000554889E55DC3
66 Flags: [ SHF_MERGE, SHF_STRINGS ]
67 AddressAlign: 0x0000000000000001
68 Content: 636C616E672076657273696F6E20332E382E3020287472756E6B203235353339332920286C6C766D2F7472756E6B203235353734352900662E63002F746D7000663100663200663300
71 AddressAlign: 0x0000000000000001
75 AddressAlign: 0x0000000000000001
76 Content: 011101250E1305030E10171B0E110112060000022E00110112064018030E3A0B3B0B3F19000000
79 AddressAlign: 0x0000000000000001
80 Content: 660000000400000000000801000000000C0000000000000000000000000000000000000000002600000002000000000000000006000000015600000000010102000000000000000006000000015600000000010202000000000000000006000000015600000000010300
81 - Name: .rela.debug_info
84 AddressAlign: 0x0000000000000008
87 - Offset: 0x0000000000000006
89 - Offset: 0x000000000000000C
91 - Offset: 0x0000000000000012
94 - Offset: 0x0000000000000016
96 - Offset: 0x000000000000001A
99 - Offset: 0x000000000000001E
101 - Offset: 0x000000000000002B
103 - Offset: 0x0000000000000039
106 - Offset: 0x0000000000000040
109 - Offset: 0x000000000000004E
112 - Offset: 0x0000000000000055
115 - Offset: 0x0000000000000063
118 - Name: .debug_ranges
120 AddressAlign: 0x0000000000000001
122 - Name: .debug_pubnames
124 AddressAlign: 0x0000000000000001
125 Content: 230000000200000000006A0000002A0000006631003F0000006632005400000066330000000000
126 - Name: .rela.debug_pubnames
129 AddressAlign: 0x0000000000000008
130 Info: .debug_pubnames
132 - Offset: 0x0000000000000006
136 Flags: [ SHF_MERGE, SHF_STRINGS ]
137 AddressAlign: 0x0000000000000001
138 Content: 00636C616E672076657273696F6E20332E382E3020287472756E6B203235353339332920286C6C766D2F7472756E6B203235353734352900
139 - Name: .note.GNU-stack
141 AddressAlign: 0x0000000000000001
144 Type: SHT_X86_64_UNWIND
146 AddressAlign: 0x0000000000000008
147 Content: 1400000000000000017A5200017810011B0C070890010000180000001C000000000000000600000000410E108602430D060000001800000038000000000000000600000000410E108602430D060000001C00000054000000000000000600000000410E108602430D0600000000000000
148 - Name: .rela.eh_frame
151 AddressAlign: 0x0000000000000008
154 - Offset: 0x0000000000000020
156 - Offset: 0x000000000000003C
159 - Offset: 0x0000000000000058
164 AddressAlign: 0x0000000000000001
165 Content: 4300000002001A0000000101FB0E0D00010101010000000100000100662E630000000000000902000000000000000001050C0A4A0500BB050C0A4A0500BB050C0A4A0202000101
166 - Name: .rela.debug_line
169 AddressAlign: 0x0000000000000008
172 - Offset: 0x0000000000000027
182 Section: .debug_abbrev
190 Size: 0x0000000000000006
195 Value: 0x0000000000000010
196 Size: 0x0000000000000006
201 Value: 0x0000000000000020
202 Size: 0x0000000000000006