brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.3 KiB · 1b790ee Raw
104 lines · plain
1; REQUIRES: x86-registered-target2 3; Test case 1 - General options4 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; Compare mode - Logical view.17; The output shows in view form the 'missing (-), added (+)' elements,18; giving more context by swapping the reference and target object files.19 20; RUN: llvm-debuginfo-analyzer --attribute=level \21; RUN:                         --compare=types \22; RUN:                         --report=view \23; RUN:                         --print=symbols,types \24; RUN:                         %p/Inputs/test-dwarf-clang.o \25; RUN:                         %p/Inputs/test-dwarf-gcc.o 2>&1 | \26; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s27 28; ONE:      Reference: 'test-dwarf-clang.o'29; ONE-NEXT: Target:    'test-dwarf-gcc.o'30; ONE-EMPTY:31; ONE-NEXT: Logical View:32; ONE-NEXT:  [000]           {File} 'test-dwarf-clang.o'33; ONE-EMPTY:34; ONE-NEXT:  [001]             {CompileUnit} 'test.cpp'35; ONE-NEXT:  [002]     1         {TypeAlias} 'INTPTR' -> '* const int'36; ONE-NEXT:  [002]     2         {Function} extern not_inlined 'foo' -> 'int'37; ONE-NEXT:  [003]                 {Block}38; ONE-NEXT: +[004]     4             {TypeAlias} 'INTEGER' -> 'int'39; ONE-NEXT:  [004]     5             {Variable} 'CONSTANT' -> 'const INTEGER'40; ONE-NEXT:  [003]     2           {Parameter} 'ParamBool' -> 'bool'41; ONE-NEXT:  [003]     2           {Parameter} 'ParamPtr' -> 'INTPTR'42; ONE-NEXT:  [003]     2           {Parameter} 'ParamUnsigned' -> 'unsigned int'43; ONE-NEXT: -[003]     4           {TypeAlias} 'INTEGER' -> 'int'44 45; Compare mode - Logical elements.46; The output shows in tabular form the 'missing (-), added (+)' elements,47; giving more context by swapping the reference and target object files.48 49; RUN: llvm-debuginfo-analyzer --attribute=level \50; RUN:                         --compare=types \51; RUN:                         --report=list \52; RUN:                         --print=symbols,types,summary \53; RUN:                         %p/Inputs/test-dwarf-clang.o \54; RUN:                         %p/Inputs/test-dwarf-gcc.o 2>&1 | \55; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s56 57; TWO:      Reference: 'test-dwarf-clang.o'58; TWO-NEXT: Target:    'test-dwarf-gcc.o'59; TWO-EMPTY:60; TWO-NEXT: (1) Missing Types:61; TWO-NEXT: -[003]     4     {TypeAlias} 'INTEGER' -> 'int'62; TWO-EMPTY:63; TWO-NEXT: (1) Added Types:64; TWO-NEXT: +[004]     4     {TypeAlias} 'INTEGER' -> 'int'65; TWO-EMPTY:66; TWO-NEXT: ----------------------------------------67; TWO-NEXT: Element   Expected    Missing      Added68; TWO-NEXT: ----------------------------------------69; TWO-NEXT: Scopes           4          0          070; TWO-NEXT: Symbols          0          0          071; TWO-NEXT: Types            2          1          172; TWO-NEXT: Lines            0          0          073; TWO-NEXT: ----------------------------------------74; TWO-NEXT: Total            6          1          175 76; Changing the 'Reference' and 'Target' order:77 78; RUN: llvm-debuginfo-analyzer --attribute=level \79; RUN:                         --compare=types \80; RUN:                         --report=list \81; RUN:                         --print=symbols,types,summary \82; RUN:                         %p/Inputs/test-dwarf-gcc.o \83; RUN:                         %p/Inputs/test-dwarf-clang.o 2>&1 | \84; RUN: FileCheck --strict-whitespace -check-prefix=THR %s85 86; THR:      Reference: 'test-dwarf-gcc.o'87; THR-NEXT: Target:    'test-dwarf-clang.o'88; THR-EMPTY:89; THR-NEXT: (1) Missing Types:90; THR-NEXT: -[004]     4     {TypeAlias} 'INTEGER' -> 'int'91; THR-EMPTY:92; THR-NEXT: (1) Added Types:93; THR-NEXT: +[003]     4     {TypeAlias} 'INTEGER' -> 'int'94; THR-EMPTY:95; THR-NEXT: ----------------------------------------96; THR-NEXT: Element   Expected    Missing      Added97; THR-NEXT: ----------------------------------------98; THR-NEXT: Scopes           4          0          099; THR-NEXT: Symbols          0          0          0100; THR-NEXT: Types            2          1          1101; THR-NEXT: Lines            0          0          0102; THR-NEXT: ----------------------------------------103; THR-NEXT: Total            6          1          1104