File: 01-dwarf-print-basic-details.test

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (69 lines) | stat: -rw-r--r-- 3,250 bytes parent folder | download | duplicates (12)
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
; REQUIRES: x86-registered-target

; Test case 1 - General options.

; test.cpp
;  1  using INTPTR = const int *;
;  2  int foo(INTPTR ParamPtr, unsigned ParamUnsigned, bool ParamBool) {
;  3    if (ParamBool) {
;  4      typedef int INTEGER;
;  5      const INTEGER CONSTANT = 7;
;  6      return CONSTANT;
;  7    }
;  8    return ParamUnsigned;
;  9  }

; Print basic details.
; The following command prints basic details for all the logical elements
; sorted by the debug information internal offset; it includes its lexical
; level and debug info format.

; RUN: llvm-debuginfo-analyzer --attribute=level,format \
; RUN:                         --output-sort=offset \
; RUN:                         --print=scopes,symbols,types,lines,instructions \
; RUN:                         %p/Inputs/test-dwarf-clang.o 2>&1 | \
; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s

; RUN: llvm-debuginfo-analyzer --attribute=level,format \
; RUN:                         --output-sort=offset \
; RUN:                         --print=elements \
; RUN:                         %p/Inputs/test-dwarf-clang.o 2>&1 | \
; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s

; ONE:      Logical View:
; ONE-NEXT: [000]           {File} 'test-dwarf-clang.o' -> elf64-x86-64
; ONE-EMPTY:
; ONE-NEXT: [001]             {CompileUnit} 'test.cpp'
; ONE-NEXT: [002]     2         {Function} extern not_inlined 'foo' -> 'int'
; ONE-NEXT: [003]     2           {Parameter} 'ParamPtr' -> 'INTPTR'
; ONE-NEXT: [003]     2           {Parameter} 'ParamUnsigned' -> 'unsigned int'
; ONE-NEXT: [003]     2           {Parameter} 'ParamBool' -> 'bool'
; ONE-NEXT: [003]                 {Block}
; ONE-NEXT: [004]     5             {Variable} 'CONSTANT' -> 'const INTEGER'
; ONE-NEXT: [004]     5             {Line}
; ONE-NEXT: [004]                   {Code} 'movl	$0x7, -0x1c(%rbp)'
; ONE-NEXT: [004]     6             {Line}
; ONE-NEXT: [004]                   {Code} 'movl	$0x7, -0x4(%rbp)'
; ONE-NEXT: [004]                   {Code} 'jmp	0x6'
; ONE-NEXT: [004]     8             {Line}
; ONE-NEXT: [004]                   {Code} 'movl	-0x14(%rbp), %eax'
; ONE-NEXT: [003]     4           {TypeAlias} 'INTEGER' -> 'int'
; ONE-NEXT: [003]     2           {Line}
; ONE-NEXT: [003]                 {Code} 'pushq	%rbp'
; ONE-NEXT: [003]                 {Code} 'movq	%rsp, %rbp'
; ONE-NEXT: [003]                 {Code} 'movb	%dl, %al'
; ONE-NEXT: [003]                 {Code} 'movq	%rdi, -0x10(%rbp)'
; ONE-NEXT: [003]                 {Code} 'movl	%esi, -0x14(%rbp)'
; ONE-NEXT: [003]                 {Code} 'andb	$0x1, %al'
; ONE-NEXT: [003]                 {Code} 'movb	%al, -0x15(%rbp)'
; ONE-NEXT: [003]     3           {Line}
; ONE-NEXT: [003]                 {Code} 'testb	$0x1, -0x15(%rbp)'
; ONE-NEXT: [003]                 {Code} 'je	0x13'
; ONE-NEXT: [003]     8           {Line}
; ONE-NEXT: [003]                 {Code} 'movl	%eax, -0x4(%rbp)'
; ONE-NEXT: [003]     9           {Line}
; ONE-NEXT: [003]                 {Code} 'movl	-0x4(%rbp), %eax'
; ONE-NEXT: [003]                 {Code} 'popq	%rbp'
; ONE-NEXT: [003]                 {Code} 'retq'
; ONE-NEXT: [003]     9           {Line}
; ONE-NEXT: [002]     1         {TypeAlias} 'INTPTR' -> '* const int'