Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / test / tools / sanstats / elf.test
blob54878a1d526b8f40c436c23a96ede79bedad05e0
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
36 # INVALID: <invalid>
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
52 --- !ELF
53 FileHeader:      
54   Class:           ELFCLASS64
55   Data:            ELFDATA2LSB
56   Type:            ET_REL
57   Machine:         EM_X86_64
58 Sections:        
59   - Name:            .text
60     Type:            SHT_PROGBITS
61     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
62     AddressAlign:    0x0000000000000010
63     Content:         554889E55DC3662E0F1F840000000000554889E55DC3662E0F1F840000000000554889E55DC3
64   - Name:            .debug_str
65     Type:            SHT_PROGBITS
66     Flags:           [ SHF_MERGE, SHF_STRINGS ]
67     AddressAlign:    0x0000000000000001
68     Content:         636C616E672076657273696F6E20332E382E3020287472756E6B203235353339332920286C6C766D2F7472756E6B203235353734352900662E63002F746D7000663100663200663300
69   - Name:            .debug_loc
70     Type:            SHT_PROGBITS
71     AddressAlign:    0x0000000000000001
72     Content:         ''
73   - Name:            .debug_abbrev
74     Type:            SHT_PROGBITS
75     AddressAlign:    0x0000000000000001
76     Content:         011101250E1305030E10171B0E110112060000022E00110112064018030E3A0B3B0B3F19000000
77   - Name:            .debug_info
78     Type:            SHT_PROGBITS
79     AddressAlign:    0x0000000000000001
80     Content:         660000000400000000000801000000000C0000000000000000000000000000000000000000002600000002000000000000000006000000015600000000010102000000000000000006000000015600000000010202000000000000000006000000015600000000010300
81   - Name:            .rela.debug_info
82     Type:            SHT_RELA
83     Link:            .symtab
84     AddressAlign:    0x0000000000000008
85     Info:            .debug_info
86     Relocations:     
87       - Offset:          0x0000000000000006
88         Symbol:          ''
89         Type:            R_X86_64_32
90       - Offset:          0x000000000000000C
91         Symbol:          ''
92         Type:            R_X86_64_32
93       - Offset:          0x0000000000000012
94         Symbol:          ''
95         Type:            R_X86_64_32
96         Addend:          55
97       - Offset:          0x0000000000000016
98         Symbol:          ''
99         Type:            R_X86_64_32
100       - Offset:          0x000000000000001A
101         Symbol:          ''
102         Type:            R_X86_64_32
103         Addend:          59
104       - Offset:          0x000000000000001E
105         Symbol:          ''
106         Type:            R_X86_64_64
107       - Offset:          0x000000000000002B
108         Symbol:          ''
109         Type:            R_X86_64_64
110       - Offset:          0x0000000000000039
111         Symbol:          ''
112         Type:            R_X86_64_32
113         Addend:          64
114       - Offset:          0x0000000000000040
115         Symbol:          ''
116         Type:            R_X86_64_64
117         Addend:          16
118       - Offset:          0x000000000000004E
119         Symbol:          ''
120         Type:            R_X86_64_32
121         Addend:          67
122       - Offset:          0x0000000000000055
123         Symbol:          ''
124         Type:            R_X86_64_64
125         Addend:          32
126       - Offset:          0x0000000000000063
127         Symbol:          ''
128         Type:            R_X86_64_32
129         Addend:          70
130   - Name:            .debug_ranges
131     Type:            SHT_PROGBITS
132     AddressAlign:    0x0000000000000001
133     Content:         ''
134   - Name:            .debug_pubnames
135     Type:            SHT_PROGBITS
136     AddressAlign:    0x0000000000000001
137     Content:         230000000200000000006A0000002A0000006631003F0000006632005400000066330000000000
138   - Name:            .rela.debug_pubnames
139     Type:            SHT_RELA
140     Link:            .symtab
141     AddressAlign:    0x0000000000000008
142     Info:            .debug_pubnames
143     Relocations:     
144       - Offset:          0x0000000000000006
145         Symbol:          ''
146         Type:            R_X86_64_32
147   - Name:            .comment
148     Type:            SHT_PROGBITS
149     Flags:           [ SHF_MERGE, SHF_STRINGS ]
150     AddressAlign:    0x0000000000000001
151     Content:         00636C616E672076657273696F6E20332E382E3020287472756E6B203235353339332920286C6C766D2F7472756E6B203235353734352900
152   - Name:            .note.GNU-stack
153     Type:            SHT_PROGBITS
154     AddressAlign:    0x0000000000000001
155     Content:         ''
156   - Name:            .eh_frame
157     Type:            SHT_X86_64_UNWIND
158     Flags:           [ SHF_ALLOC ]
159     AddressAlign:    0x0000000000000008
160     Content:         1400000000000000017A5200017810011B0C070890010000180000001C000000000000000600000000410E108602430D060000001800000038000000000000000600000000410E108602430D060000001C00000054000000000000000600000000410E108602430D0600000000000000
161   - Name:            .rela.eh_frame
162     Type:            SHT_RELA
163     Link:            .symtab
164     AddressAlign:    0x0000000000000008
165     Info:            .eh_frame
166     Relocations:     
167       - Offset:          0x0000000000000020
168         Symbol:          ''
169         Type:            R_X86_64_PC32
170       - Offset:          0x000000000000003C
171         Symbol:          ''
172         Type:            R_X86_64_PC32
173         Addend:          16
174       - Offset:          0x0000000000000058
175         Symbol:          ''
176         Type:            R_X86_64_PC32
177         Addend:          32
178   - Name:            .debug_line
179     Type:            SHT_PROGBITS
180     AddressAlign:    0x0000000000000001
181     Content:         4300000002001A0000000101FB0E0D00010101010000000100000100662E630000000000000902000000000000000001050C0A4A0500BB050C0A4A0500BB050C0A4A0202000101
182   - Name:            .rela.debug_line
183     Type:            SHT_RELA
184     Link:            .symtab
185     AddressAlign:    0x0000000000000008
186     Info:            .debug_line
187     Relocations:     
188       - Offset:          0x0000000000000027
189         Symbol:          ''
190         Type:            R_X86_64_64
191 Symbols:         
192   Local:           
193     - Name:            f.c
194       Type:            STT_FILE
195     - Type:            STT_SECTION
196       Section:         .text
197     - Type:            STT_SECTION
198       Section:         .debug_str
199     - Type:            STT_SECTION
200       Section:         .debug_abbrev
201     - Type:            STT_SECTION
202       Section:         .debug_info
203     - Type:            STT_SECTION
204       Section:         .debug_line
205   Global:          
206     - Name:            f1
207       Type:            STT_FUNC
208       Section:         .text
209       Size:            0x0000000000000006
210     - Name:            f2
211       Type:            STT_FUNC
212       Section:         .text
213       Value:           0x0000000000000010
214       Size:            0x0000000000000006
215     - Name:            f3
216       Type:            STT_FUNC
217       Section:         .text
218       Value:           0x0000000000000020
219       Size:            0x0000000000000006