93 lines · plain
1# Test of the llmv-dwarfdump --statistics newly added stats (version >= 3).2#3RUN: llvm-mc -triple x86_64-unknown-linux-gnu %S/Inputs/statistics-fib.s -filetype=obj -o %t-statistics-fib.o4RUN: llvm-dwarfdump --statistics %t-statistics-fib.o | FileCheck %s5 6# Source program - A version of Fibonacci7# Compilation options: -g -O3 -c8#9# int10# 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# int24# 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 67CHECK: "version": 9,68CHECK: "#functions": 3,69CHECK: "#functions with location": 3,70CHECK: "#out-of-line functions": 3,71CHECK: "#inlined functions": 8,72CHECK: "#inlined functions with abstract origins": 8,73CHECK: "#unique source variables": 9,74CHECK: "#source variables": 33,75 76# Ideally the value below would be 33 but currently it's not.77CHECK: "#source variables with location": 24,78CHECK: "#call site entries": 8,79CHECK: "sum_all_variables(#bytes in parent scope)": 3072,80CHECK: "sum_all_variables(#bytes in parent scope covered by DW_AT_location)": 1188,81CHECK: "#bytes within functions": 636,82CHECK: "#bytes within inlined functions": 388,83CHECK: "#params": 13,84CHECK-NEXT: "#params with source location": 13,85CHECK-NEXT: "#params with type": 13,86CHECK-NEXT: "#params with binary location": 13,87CHECK-NEXT: "#local vars": 20,88CHECK-NEXT: "#local vars with source location": 20,89CHECK-NEXT: "#local vars with type": 20,90 91# Ideally the value below would be 20, but currently it's not.92CHECK-NEXT: "#local vars with binary location": 11,93