1 ; REQUIRES: x86-registered-target
3 ; Test case 6 - Full logical view
6 ; 1 using INTPTR = const int *;
7 ; 2 int foo(INTPTR ParamPtr, unsigned ParamUnsigned, bool ParamBool) {
9 ; 4 typedef int INTEGER;
10 ; 5 const INTEGER CONSTANT = 7;
13 ; 8 return ParamUnsigned;
16 ; Print low level details.
17 ; The following command prints low level information that includes
18 ; offsets within the debug information section, debug location
19 ; operands, linkage names, etc.
21 ; RUN: llvm-debuginfo-analyzer --attribute=all \
23 ; RUN: %p/Inputs/test-codeview-clang.o 2>&1 | \
24 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
27 ; ONE-NEXT: [0x0000000000][000] {File} '{{.*}}test-codeview-clang.o' -> COFF-x86-64
29 ; ONE-NEXT: [0x0000000000][001] {CompileUnit} 'test.cpp'
30 ; ONE-NEXT: [0x0000000000][002] {Producer} 'clang version 15.0.0 {{.*}}'
31 ; ONE-NEXT: {Directory} 'test.cpp'
32 ; ONE-NEXT: {Directory} 'x:/tests/input'
33 ; ONE-NEXT: {File} 'general'
34 ; ONE-NEXT: {File} 'test.cpp'
35 ; ONE-NEXT: {Public} 'foo' [0x0000000000:0x0000000046]
36 ; ONE-NEXT: [0x0000000000][002] {TypeAlias} 'INTPTR' -> [0x0000001001]'* const int'
37 ; ONE-NEXT: [0x0000000030][002] {BaseType} 'bool'
38 ; ONE-NEXT: [0x0000000000][002] {Function} extern not_inlined 'foo' -> [0x0000000074]'int'
39 ; ONE-NEXT: [0x0000000000][003] {Range} Lines 2:9 [0x0000000000:0x0000000046]
40 ; ONE-NEXT: [0x0000000000][003] {Linkage} 0x1 '?foo@@YAHPEBHI_N@Z'
41 ; ONE-NEXT: [0x0000000000][003] {TypeAlias} 'INTEGER' -> [0x0000000074]'int'
42 ; ONE-NEXT: [0x0000000000][003] {Parameter} 'ParamBool' -> [0x0000000030]'bool'
43 ; ONE-NEXT: [0x0000000000][004] {Coverage} 70.00% (49/70)
44 ; ONE-NEXT: [0x0000000000][004] {Location} Lines 3:9 [0x0000000016:0x0000000047]
45 ; ONE-NEXT: [0x0000000000][005] {Entry} frame_pointer_rel 27
46 ; ONE-NEXT: [0x0000000000][003] {Parameter} 'ParamPtr' -> [0x0000001001]'* const int'
47 ; ONE-NEXT: [0x0000000000][004] {Coverage} 70.00% (49/70)
48 ; ONE-NEXT: [0x0000000000][004] {Location} Lines 3:9 [0x0000000016:0x0000000047]
49 ; ONE-NEXT: [0x0000000000][005] {Entry} frame_pointer_rel 8
50 ; ONE-NEXT: [0x0000000000][003] {Parameter} 'ParamUnsigned' -> [0x0000000075]'unsigned'
51 ; ONE-NEXT: [0x0000000000][004] {Coverage} 70.00% (49/70)
52 ; ONE-NEXT: [0x0000000000][004] {Location} Lines 3:9 [0x0000000016:0x0000000047]
53 ; ONE-NEXT: [0x0000000000][005] {Entry} frame_pointer_rel 20
54 ; ONE-NEXT: [0x0000000000][003] {Block}
55 ; ONE-NEXT: [0x0000000000][004] {Range} Lines ?:? [0x0000000021:0x0000000035]
56 ; ONE-NEXT: [0x0000000000][004] {Variable} 'CONSTANT' -> [0x0000001000]'const int'
57 ; ONE-NEXT: [0x0000000000][005] {Coverage} 105.00% (21/20)
58 ; ONE-NEXT: [0x0000000000][005] {Location} Lines ?:? [0x0000000021:0x0000000036]
59 ; ONE-NEXT: [0x0000000000][006] {Entry} frame_pointer_rel 4
61 ; ONE-NEXT: [0x0000000021][004] {Source} 'x:/tests/input/general/test.cpp'
62 ; ONE-NEXT: [0x0000000021][004] 5 {Line} 'x:/tests/input/general/test.cpp'
63 ; ONE-NEXT: [0x0000000021][004] {Code} 'movl $0x7, 0x4(%rsp)'
64 ; ONE-NEXT: [0x0000000029][004] 6 {Line} 'x:/tests/input/general/test.cpp'
65 ; ONE-NEXT: [0x0000000029][004] {Code} 'movl $0x7, 0x1c(%rsp)'
66 ; ONE-NEXT: [0x0000000031][004] {Code} 'jmp 0x8'
67 ; ONE-NEXT: [0x0000000000][003] 2 {Line} 'x:/tests/input/general/test.cpp'
68 ; ONE-NEXT: [0x0000000000][003] {Code} 'subq $0x20, %rsp'
69 ; ONE-NEXT: [0x0000000004][003] {Code} 'andb $0x1, %r8b'
70 ; ONE-NEXT: [0x0000000008][003] {Code} 'movb %r8b, 0x1b(%rsp)'
71 ; ONE-NEXT: [0x000000000d][003] {Code} 'movl %edx, 0x14(%rsp)'
72 ; ONE-NEXT: [0x0000000011][003] {Code} 'movq %rcx, 0x8(%rsp)'
73 ; ONE-NEXT: [0x0000000016][003] 3 {Line} 'x:/tests/input/general/test.cpp'
74 ; ONE-NEXT: [0x0000000016][003] {Code} 'testb $0x1, 0x1b(%rsp)'
75 ; ONE-NEXT: [0x000000001b][003] {Code} 'je 0x15'
76 ; ONE-NEXT: [0x0000000036][003] 8 {Line} 'x:/tests/input/general/test.cpp'
77 ; ONE-NEXT: [0x0000000036][003] {Code} 'movl 0x14(%rsp), %eax'
78 ; ONE-NEXT: [0x000000003a][003] {Code} 'movl %eax, 0x1c(%rsp)'
79 ; ONE-NEXT: [0x000000003e][003] 9 {Line} 'x:/tests/input/general/test.cpp'
80 ; ONE-NEXT: [0x000000003e][003] {Code} 'movl 0x1c(%rsp), %eax'
81 ; ONE-NEXT: [0x0000000042][003] {Code} 'addq $0x20, %rsp'
82 ; ONE-NEXT: [0x0000000046][003] {Code} 'retq'
83 ; ONE-NEXT: [0x0000000074][002] {BaseType} 'int'
84 ; ONE-NEXT: [0x0000000075][002] {BaseType} 'unsigned'
86 ; ONE-NEXT: -----------------------------
87 ; ONE-NEXT: Element Total Printed
88 ; ONE-NEXT: -----------------------------
89 ; ONE-NEXT: Scopes 3 3
90 ; ONE-NEXT: Symbols 4 4
92 ; ONE-NEXT: Lines 21 21
93 ; ONE-NEXT: -----------------------------
94 ; ONE-NEXT: Total 33 33
96 ; ONE-NEXT: Scope Sizes:
98 ; ONE-NEXT: Totals by lexical level: