1 # Test of the llmv-dwarfdump --statistics newly added stats (version >= 3).
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
6 # Source program - A version of Fibonacci
7 # Compilation options: -g -O3 -c
10 # real_fib (int x, int answers[11])
14 # if ((answers)[x] != -1)
15 # return (answers)[x];
17 # result = real_fib(x-1, answers) + real_fib(x-2, answers);
18 # (answers)[x] = result;
32 # for (i = 0; i < 11; i++)
39 # return real_fib(x, answers);
42 # int main (int argc, char **argv)
47 # printf ("fibonacci(3) = %d\n", result);
49 # printf ("fibonacci(4) = %d\n", result);
51 # printf ("fibonacci(5) = %d\n", result);
53 # printf ("fibonacci(6) = %d\n", result);
55 # printf ("fibonacci(7) = %d\n", result);
57 # printf ("fibonacci(8) = %d\n", result);
59 # printf ("fibonacci(9) = %d\n", result);
61 # printf ("fibonacci(10) = %d\n", result);
68 CHECK: "#functions": 3,
69 CHECK: "#functions with location": 3,
70 CHECK: "#inlined functions": 8,
71 CHECK: "#inlined functions with abstract origins": 8,
72 CHECK: "#unique source variables": 9,
73 CHECK: "#source variables": 33,
75 # Ideally the value below would be 33 but currently it's not.
76 CHECK: "#source variables with location": 24,
77 CHECK: "#call site entries": 8,
78 CHECK: "sum_all_variables(#bytes in parent scope)": 3072,
79 CHECK: "sum_all_variables(#bytes in parent scope covered by DW_AT_location)": 1188,
80 CHECK: "#bytes within functions": 636,
81 CHECK: "#bytes within inlined functions": 388,
83 CHECK-NEXT: "#params with source location": 13,
84 CHECK-NEXT: "#params with type": 13,
85 CHECK-NEXT: "#params with binary location": 13,
86 CHECK-NEXT: "#local vars": 20,
87 CHECK-NEXT: "#local vars with source location": 20,
88 CHECK-NEXT: "#local vars with type": 20,
90 # Ideally the value below would be 20, but currently it's not.
91 CHECK-NEXT: "#local vars with binary location": 11,