1 # Test of the llmv-dwarfdump --statistics with split dwarf (dwo files)
4 # Create a directory in which to put all files, so .o file can find .dwo file.
5 RUN: rm -rf %t && mkdir -p %t
6 RUN: cp -f %S/Inputs/statistics-fib.split-dwarf.s %t/.
8 RUN: llvm-mc -triple x86_64-unknown-linux-gnu statistics-fib.split-dwarf.s -filetype=obj -split-dwarf-file statistics-fib.split-dwarf.dwo -o statistics-fib.split-dwarf.o
9 RUN: llvm-dwarfdump --statistics statistics-fib.split-dwarf.o | FileCheck %s
11 # Source program - A version of Fibonacci
12 # Compilation options: -gsplit-dwarf -O3 -c -S
15 # real_fib (int x, int answers[11])
19 # if ((answers)[x] != -1)
20 # return (answers)[x];
22 # result = real_fib(x-1, answers) + real_fib(x-2, answers);
23 # (answers)[x] = result;
37 # for (i = 0; i < 11; i++)
44 # return real_fib(x, answers);
47 # int main (int argc, char **argv)
52 # printf ("fibonacci(3) = %d\n", result);
54 # printf ("fibonacci(4) = %d\n", result);
56 # printf ("fibonacci(5) = %d\n", result);
58 # printf ("fibonacci(6) = %d\n", result);
60 # printf ("fibonacci(7) = %d\n", result);
62 # printf ("fibonacci(8) = %d\n", result);
64 # printf ("fibonacci(9) = %d\n", result);
66 # printf ("fibonacci(10) = %d\n", result);
73 CHECK: "#functions": 3,
74 CHECK: "#functions with location": 3,
75 CHECK: "#inlined functions": 7,
76 CHECK: "#inlined functions with abstract origins": 7,
77 CHECK: "#unique source variables": 9,
78 CHECK: "#source variables": 30,
80 # Ideally the value below would be 33 but currently it's not.
81 CHECK: "#source variables with location": 22,
82 CHECK: "#call site entries": 7,
83 CHECK: "sum_all_variables(#bytes in parent scope)": 2817,
84 CHECK: "sum_all_variables(#bytes in parent scope covered by DW_AT_location)": 1160,
85 CHECK: "#bytes within functions": 594,
86 CHECK: "#bytes within inlined functions": 345,
88 CHECK-NEXT: "#params with source location": 12,
89 CHECK-NEXT: "#params with type": 12,
90 CHECK-NEXT: "#params with binary location": 12,
91 CHECK-NEXT: "#local vars": 18,
92 CHECK-NEXT: "#local vars with source location": 18,
93 CHECK-NEXT: "#local vars with type": 18,
95 # Ideally the value below would be 18, but currently it's not.
96 CHECK: "#local vars with binary location": 10,