xref: /llvm-project/lld/test/ELF/lto/stats-file-option.ll (revision 62f7dc7c037c880f0179ce29be3a7310e5cfa548)
1; REQUIRES: asserts, x86
2
3; RUN: llvm-as -o %t.bc %s
4
5;; Try to save statistics to file.
6; RUN: ld.lld --plugin-opt=stats-file=%t2.stats -m elf_x86_64 -r -o %t.o %t.bc
7; RUN: FileCheck --input-file=%t2.stats %s
8
9; CHECK: {
10; CHECK: "asm-printer.EmittedInsts":
11; CHECK: "inline.NumInlined":
12; CHECK: "prologepilog.NumFuncSeen":
13; CHECK: }
14
15target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
16target triple = "x86_64-unknown-linux-gnu"
17
18declare i32 @patatino()
19
20define i32 @tinkywinky() {
21  %a = call i32 @patatino()
22  ret i32 %a
23}
24
25define i32 @main() !prof !0 {
26  %i = call i32 @tinkywinky()
27  ret i32 %i
28}
29
30!0 = !{!"function_entry_count", i64 300}
31