brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · 81ca701 Raw
98 lines · plain
1# Test of the llmv-dwarfdump --statistics with split dwarf (dwo files)2# (version >= 3).3#4# Create a directory in which to put all files, so .o file can find .dwo file.5RUN: rm -rf %t && mkdir -p %t6RUN: cp -f %S/Inputs/statistics-fib.split-dwarf.s %t/.7RUN: cd %t8RUN: 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.o9RUN: llvm-dwarfdump --statistics statistics-fib.split-dwarf.o | FileCheck %s10 11# Source program - A version of Fibonacci12# Compilation options:  -gsplit-dwarf -O3 -c -S13#14# int15# real_fib (int x, int answers[11])16# {17#   int result;18# 19#   if ((answers)[x] != -1)20#     return (answers)[x];21# 22#   result = real_fib(x-1, answers) + real_fib(x-2, answers);23#   (answers)[x] = result;24# 25#   return result;26# }27# 28# int29# fib (int x)30# {31#   int answers[11];32#   int i;33# 34#   if (x > 10)35#     return -1;36# 37#   for (i = 0; i < 11; i++)38#     answers[i] = -1;39# 40#   answers[0] = 0;41#   answers[1] = 1;42#   answers[2] = 1;43# 44#   return real_fib(x, answers);45# }46# 47# int main (int argc, char **argv)48# {49#   int result;50# 51#   result = fib(3);52#   printf ("fibonacci(3) = %d\n", result);53#   result = fib(4);54#   printf ("fibonacci(4) = %d\n", result);55#   result = fib(5);56#   printf ("fibonacci(5) = %d\n", result);57#   result = fib(6);58#   printf ("fibonacci(6) = %d\n", result);59#   result = fib(7);60#   printf ("fibonacci(7) = %d\n", result);61#   result = fib(8);62#   printf ("fibonacci(8) = %d\n", result);63#   result = fib(9);64#   printf ("fibonacci(9) = %d\n", result);65#   result = fib(10);66#   printf ("fibonacci(10) = %d\n", result);67# 68#   return 0;69# }70#71 72CHECK:      "version": 9,73CHECK:      "#functions": 3,74CHECK:      "#functions with location": 3,75CHECK:      "#out-of-line functions": 3,76CHECK:      "#inlined functions": 7,77CHECK:      "#inlined functions with abstract origins": 7,78CHECK:      "#unique source variables": 9,79CHECK:      "#source variables": 30,80 81# Ideally the value below would be 33 but currently it's not.82CHECK:      "#source variables with location": 22,83CHECK:      "#call site entries": 7,84CHECK:      "sum_all_variables(#bytes in parent scope)": 2817,85CHECK:      "sum_all_variables(#bytes in parent scope covered by DW_AT_location)": 1160,86CHECK:      "#bytes within functions": 594,87CHECK:      "#bytes within inlined functions": 345,88CHECK:      "#params": 12,89CHECK-NEXT: "#params with source location": 12,90CHECK-NEXT: "#params with type": 12,91CHECK-NEXT: "#params with binary location": 12,92CHECK-NEXT: "#local vars": 18,93CHECK-NEXT: "#local vars with source location": 18,94CHECK-NEXT: "#local vars with type": 18,95 96# Ideally the value below would be 18, but currently it's not.97CHECK:      "#local vars with binary location": 10,98