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
90 - Offset: 0x000000000000000C
93 - Offset: 0x0000000000000012
97 - Offset: 0x0000000000000016
100 - Offset: 0x000000000000001A
104 - Offset: 0x000000000000001E
107 - Offset: 0x000000000000002B
110 - Offset: 0x0000000000000039
114 - Offset: 0x0000000000000040
118 - Offset: 0x000000000000004E
122 - Offset: 0x0000000000000055
126 - Offset: 0x0000000000000063
130 - Name: .debug_ranges
132 AddressAlign: 0x0000000000000001
134 - Name: .debug_pubnames
136 AddressAlign: 0x0000000000000001
137 Content: 230000000200000000006A0000002A0000006631003F0000006632005400000066330000000000
138 - Name: .rela.debug_pubnames
141 AddressAlign: 0x0000000000000008
142 Info: .debug_pubnames
144 - Offset: 0x0000000000000006
149 Flags: [ SHF_MERGE, SHF_STRINGS ]
150 AddressAlign: 0x0000000000000001
151 Content: 00636C616E672076657273696F6E20332E382E3020287472756E6B203235353339332920286C6C766D2F7472756E6B203235353734352900
152 - Name: .note.GNU-stack
154 AddressAlign: 0x0000000000000001
157 Type: SHT_X86_64_UNWIND
159 AddressAlign: 0x0000000000000008
160 Content: 1400000000000000017A5200017810011B0C070890010000180000001C000000000000000600000000410E108602430D060000001800000038000000000000000600000000410E108602430D060000001C00000054000000000000000600000000410E108602430D0600000000000000
161 - Name: .rela.eh_frame
164 AddressAlign: 0x0000000000000008
167 - Offset: 0x0000000000000020
170 - Offset: 0x000000000000003C
174 - Offset: 0x0000000000000058
180 AddressAlign: 0x0000000000000001
181 Content: 4300000002001A0000000101FB0E0D00010101010000000100000100662E630000000000000902000000000000000001050C0A4A0500BB050C0A4A0500BB050C0A4A0202000101
182 - Name: .rela.debug_line
185 AddressAlign: 0x0000000000000008
188 - Offset: 0x0000000000000027
200 Section: .debug_abbrev
209 Size: 0x0000000000000006
213 Value: 0x0000000000000010
214 Size: 0x0000000000000006
218 Value: 0x0000000000000020
219 Size: 0x0000000000000006