brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.4 KiB · 0696c57 Raw
106 lines · plain
1; REQUIRES: x86-registered-target2 3; Test case 1 - General options.4 5; test.cpp6;  1  using INTPTR = const int *;7;  2  int foo(INTPTR ParamPtr, unsigned ParamUnsigned, bool ParamBool) {8;  3    if (ParamBool) {9;  4      typedef int INTEGER;10;  5      const INTEGER CONSTANT = 7;11;  6      return CONSTANT;12;  7    }13;  8    return ParamUnsigned;14;  9  }15 16; Print basic details.17; The following command prints basic details for all the logical elements18; sorted by the debug information internal offset; it includes its lexical19; level and debug info format.20 21; RUN: llvm-debuginfo-analyzer --attribute=level,format \22; RUN:                         --output-sort=id \23; RUN:                         --print=scopes,symbols,types,lines,instructions \24; RUN:                         %p/Inputs/test-codeview-clang.o 2>&1 | \25; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s26 27; RUN: llvm-debuginfo-analyzer --attribute=level,format \28; RUN:                         --output-sort=id \29; RUN:                         --print=elements \30; RUN:                         %p/Inputs/test-codeview-clang.o 2>&1 | \31; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s32 33; ONE:      Logical View:34; ONE-NEXT: [000]           {File} 'test-codeview-clang.o' -> COFF-x86-6435; ONE-EMPTY:36; ONE-NEXT: [001]             {CompileUnit} 'test.cpp'37; ONE-NEXT: [002]               {Function} extern not_inlined 'foo' -> 'int'38; ONE-NEXT: [003]                 {Parameter} 'ParamPtr' -> '* const int'39; ONE-NEXT: [003]                 {Parameter} 'ParamUnsigned' -> 'unsigned'40; ONE-NEXT: [003]                 {Parameter} 'ParamBool' -> 'bool'41; ONE-NEXT: [003]                 {Block}42; ONE-NEXT: [004]                   {Variable} 'CONSTANT' -> 'const int'43; ONE-NEXT: [004]     5             {Line}44; ONE-NEXT: [004]                   {Code} 'movl	$0x7, 0x4(%rsp)'45; ONE-NEXT: [004]     6             {Line}46; ONE-NEXT: [004]                   {Code} 'movl	$0x7, 0x1c(%rsp)'47; ONE-NEXT: [004]                   {Code} 'jmp	0x8'48; ONE-NEXT: [003]                 {TypeAlias} 'INTEGER' -> 'int'49; ONE-NEXT: [003]     2           {Line}50; ONE-NEXT: [003]                 {Code} 'subq	$0x20, %rsp'51; ONE-NEXT: [003]                 {Code} 'andb	$0x1, %r8b'52; ONE-NEXT: [003]                 {Code} 'movb	%r8b, 0x1b(%rsp)'53; ONE-NEXT: [003]                 {Code} 'movl	%edx, 0x14(%rsp)'54; ONE-NEXT: [003]                 {Code} 'movq	%rcx, 0x8(%rsp)'55; ONE-NEXT: [003]     3           {Line}56; ONE-NEXT: [003]                 {Code} 'testb	$0x1, 0x1b(%rsp)'57; ONE-NEXT: [003]                 {Code} 'je	0x15'58; ONE-NEXT: [003]     8           {Line}59; ONE-NEXT: [003]                 {Code} 'movl	0x14(%rsp), %eax'60; ONE-NEXT: [003]                 {Code} 'movl	%eax, 0x1c(%rsp)'61; ONE-NEXT: [003]     9           {Line}62; ONE-NEXT: [003]                 {Code} 'movl	0x1c(%rsp), %eax'63; ONE-NEXT: [003]                 {Code} 'addq	$0x20, %rsp'64; ONE-NEXT: [003]                 {Code} 'retq'65; ONE-NEXT: [002]               {TypeAlias} 'INTPTR' -> '* const int'66 67; RUN: llvm-debuginfo-analyzer --attribute=level,format \68; RUN:                         --output-sort=none \69; RUN:                         --print=scopes,symbols,types,lines,instructions \70; RUN:                         %p/Inputs/test-codeview-clang.o 2>&1 | \71; RUN: FileCheck --strict-whitespace -check-prefix=ONE-NOSORT %s72 73; ONE-NOSORT:      Logical View:74; ONE-NOSORT-NEXT: [000]           {File} 'test-codeview-clang.o' -> COFF-x86-6475; ONE-NOSORT-EMPTY:76; ONE-NOSORT-NEXT: [001]             {CompileUnit} 'test.cpp'77; ONE-NOSORT-NEXT: [002]               {Function} extern not_inlined 'foo' -> 'int'78; ONE-NOSORT-NEXT: [003]                 {Block}79; ONE-NOSORT-NEXT: [004]                   {Variable} 'CONSTANT' -> 'const int'80; ONE-NOSORT-NEXT: [004]     5             {Line}81; ONE-NOSORT-NEXT: [004]                   {Code} 'movl	$0x7, 0x4(%rsp)'82; ONE-NOSORT-NEXT: [004]     6             {Line}83; ONE-NOSORT-NEXT: [004]                   {Code} 'movl	$0x7, 0x1c(%rsp)'84; ONE-NOSORT-NEXT: [004]                   {Code} 'jmp	0x8'85; ONE-NOSORT-NEXT: [003]                 {TypeAlias} 'INTEGER' -> 'int'86; ONE-NOSORT-NEXT: [003]                 {Parameter} 'ParamPtr' -> '* const int'87; ONE-NOSORT-NEXT: [003]                 {Parameter} 'ParamUnsigned' -> 'unsigned'88; ONE-NOSORT-NEXT: [003]                 {Parameter} 'ParamBool' -> 'bool'89; ONE-NOSORT-NEXT: [003]     2           {Line}90; ONE-NOSORT-NEXT: [003]                 {Code} 'subq	$0x20, %rsp'91; ONE-NOSORT-NEXT: [003]                 {Code} 'andb	$0x1, %r8b'92; ONE-NOSORT-NEXT: [003]                 {Code} 'movb	%r8b, 0x1b(%rsp)'93; ONE-NOSORT-NEXT: [003]                 {Code} 'movl	%edx, 0x14(%rsp)'94; ONE-NOSORT-NEXT: [003]                 {Code} 'movq	%rcx, 0x8(%rsp)'95; ONE-NOSORT-NEXT: [003]     3           {Line}96; ONE-NOSORT-NEXT: [003]                 {Code} 'testb	$0x1, 0x1b(%rsp)'97; ONE-NOSORT-NEXT: [003]                 {Code} 'je	0x15'98; ONE-NOSORT-NEXT: [003]     8           {Line}99; ONE-NOSORT-NEXT: [003]                 {Code} 'movl	0x14(%rsp), %eax'100; ONE-NOSORT-NEXT: [003]                 {Code} 'movl	%eax, 0x1c(%rsp)'101; ONE-NOSORT-NEXT: [003]     9           {Line}102; ONE-NOSORT-NEXT: [003]                 {Code} 'movl	0x1c(%rsp), %eax'103; ONE-NOSORT-NEXT: [003]                 {Code} 'addq	$0x20, %rsp'104; ONE-NOSORT-NEXT: [003]                 {Code} 'retq'105; ONE-NOSORT-NEXT: [002]               {TypeAlias} 'INTPTR' -> '* const int'106