reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
# Test of the llmv-dwarfdump --statistics newly added stats (version 3).
#
RUN: llvm-mc -triple x86_64-unknown-linux-gnu %S/Inputs/statistics-fib.s -filetype=obj -o %t-statistics-fib.o
RUN: llvm-dwarfdump --statistics %t-statistics-fib.o | FileCheck %s

# Source program - A version of Fibonacci
# Compilation options:  -g -O3 -c
#
# int
# real_fib (int x, int answers[11])
# {
#   int result;
# 
#   if ((answers)[x] != -1)
#     return (answers)[x];
# 
#   result = real_fib(x-1, answers) + real_fib(x-2, answers);
#   (answers)[x] = result;
# 
#   return result;
# }
# 
# int
# fib (int x)
# {
#   int answers[11];
#   int i;
# 
#   if (x > 10)
#     return -1;
# 
#   for (i = 0; i < 11; i++)
#     answers[i] = -1;
# 
#   answers[0] = 0;
#   answers[1] = 1;
#   answers[2] = 1;
# 
#   return real_fib(x, answers);
# }
# 
# int main (int argc, char **argv)
# {
#   int result;
# 
#   result = fib(3);
#   printf ("fibonacci(3) = %d\n", result);
#   result = fib(4);
#   printf ("fibonacci(4) = %d\n", result);
#   result = fib(5);
#   printf ("fibonacci(5) = %d\n", result);
#   result = fib(6);
#   printf ("fibonacci(6) = %d\n", result);
#   result = fib(7);
#   printf ("fibonacci(7) = %d\n", result);
#   result = fib(8);
#   printf ("fibonacci(8) = %d\n", result);
#   result = fib(9);
#   printf ("fibonacci(9) = %d\n", result);
#   result = fib(10);
#   printf ("fibonacci(10) = %d\n", result);
# 
#   return 0;
# }
#

CHECK: "version":3
CHECK: "source functions":3
CHECK: "source functions with location":3
CHECK: "inlined functions":8
CHECK: "inlined funcs with abstract origins":8
CHECK: "unique source variables":9
CHECK: "source variables":33

# Ideally the value below would be 33 but currently it's not.
CHECK: "variables with location":24
CHECK: "call site entries":8
CHECK: "scope bytes total":2958
CHECK: "scope bytes covered":1188
CHECK: "total function size":636
CHECK: "total inlined function size":388
CHECK: "total formal params":13
CHECK: "formal params with source location":13
CHECK: "formal params with type":13
CHECK: "formal params with binary location":13
CHECK: "total vars":20
CHECK: "vars with source location":20
CHECK: "vars with type":20

# Ideally the value below would be 20, but currently it's not.
CHECK: "vars with binary location":11