Debian Codegraph @

llvm/test/tools/llvm-dwarfdump/X86/statistics-v3.test

raw
1 # Test of the llmv-dwarfdump --statistics newly added stats (version >= 3).
2 #
3 RUN: llvm-mc -triple x86_64-unknown-linux-gnu %S/Inputs/statistics-fib.s -filetype=obj -o %t-statistics-fib.o
4 RUN: llvm-dwarfdump --statistics %t-statistics-fib.o | FileCheck %s
5
6 # Source program - A version of Fibonacci
7 # Compilation options: -g -O3 -c
8 #
9 # int
10 # real_fib (int x, int answers[11])
11 # {
12 # int result;
13 #
14 # if ((answers)[x] != -1)
15 # return (answers)[x];
16 #
17 # result = real_fib(x-1, answers) + real_fib(x-2, answers);
18 # (answers)[x] = result;
19 #
20 # return result;
21 # }
22 #
23 # int
24 # fib (int x)
25 # {
26 # int answers[11];
27 # int i;
28 #
29 # if (x > 10)
30 # return -1;
31 #
32 # for (i = 0; i < 11; i++)
33 # answers[i] = -1;
34 #
35 # answers[0] = 0;
36 # answers[1] = 1;
37 # answers[2] = 1;
38 #
39 # return real_fib(x, answers);
40 # }
41 #
42 # int main (int argc, char **argv)
43 # {
44 # int result;
45 #
46 # result = fib(3);
47 # printf ("fibonacci(3) = %d\n", result);
48 # result = fib(4);
49 # printf ("fibonacci(4) = %d\n", result);
50 # result = fib(5);
51 # printf ("fibonacci(5) = %d\n", result);
52 # result = fib(6);
53 # printf ("fibonacci(6) = %d\n", result);
54 # result = fib(7);
55 # printf ("fibonacci(7) = %d\n", result);
56 # result = fib(8);
57 # printf ("fibonacci(8) = %d\n", result);
58 # result = fib(9);
59 # printf ("fibonacci(9) = %d\n", result);
60 # result = fib(10);
61 # printf ("fibonacci(10) = %d\n", result);
62 #
63 # return 0;
64 # }
65 #
66
67 CHECK: "version": 9,
68 CHECK: "#functions": 3,
69 CHECK: "#functions with location": 3,
70 CHECK: "#out-of-line functions": 3,
71 CHECK: "#inlined functions": 8,
72 CHECK: "#inlined functions with abstract origins": 8,
73 CHECK: "#unique source variables": 9,
74 CHECK: "#source variables": 33,
75
76 # Ideally the value below would be 33 but currently it's not.
77 CHECK: "#source variables with location": 24,
78 CHECK: "#call site entries": 8,
79 CHECK: "sum_all_variables(#bytes in parent scope)": 3072,
80 CHECK: "sum_all_variables(#bytes in parent scope covered by DW_AT_location)": 1188,
81 CHECK: "#bytes within functions": 636,
82 CHECK: "#bytes within inlined functions": 388,
83 CHECK: "#params": 13,
84 CHECK-NEXT: "#params with source location": 13,
85 CHECK-NEXT: "#params with type": 13,
86 CHECK-NEXT: "#params with binary location": 13,
87 CHECK-NEXT: "#local vars": 20,
88 CHECK-NEXT: "#local vars with source location": 20,
89 CHECK-NEXT: "#local vars with type": 20,
90
91 # Ideally the value below would be 20, but currently it's not.
92 CHECK-NEXT: "#local vars with binary location": 11,