brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.4 KiB · 98fc47e Raw
107 lines · plain
1; REQUIRES: webassembly-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-mc -arch=wasm32 -filetype=obj \21; RUN:         %p/Inputs/test-clang.s -o %t.test-clang.o22 23; RUN: llvm-debuginfo-analyzer --attribute=level \24; RUN:                         --compare=types \25; RUN:                         --report=view \26; RUN:                         --print=symbols,types \27; RUN:                         %t.test-clang.o \28; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o 2>&1 | \29; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s30 31; ONE:      Reference: '{{.*}}test-clang.o'32; ONE-NEXT: Target:    'test-dwarf-gcc.o'33; ONE-EMPTY:34; ONE-NEXT: Logical View:35; ONE-NEXT:  [000]           {File} '{{.*}}test-clang.o'36; ONE-EMPTY:37; ONE-NEXT:  [001]             {CompileUnit} 'test.cpp'38; ONE-NEXT:  [002]     1         {TypeAlias} 'INTPTR' -> '* const int'39; ONE-NEXT:  [002]     2         {Function} extern not_inlined 'foo' -> 'int'40; ONE-NEXT:  [003]                 {Block}41; ONE-NEXT: +[004]     4             {TypeAlias} 'INTEGER' -> 'int'42; ONE-NEXT:  [004]     5             {Variable} 'CONSTANT' -> 'const INTEGER'43; ONE-NEXT:  [003]     2           {Parameter} 'ParamBool' -> 'bool'44; ONE-NEXT:  [003]     2           {Parameter} 'ParamPtr' -> 'INTPTR'45; ONE-NEXT:  [003]     2           {Parameter} 'ParamUnsigned' -> 'unsigned int'46; ONE-NEXT: -[003]     4           {TypeAlias} 'INTEGER' -> 'int'47 48; Compare mode - Logical elements.49; The output shows in tabular form the 'missing (-), added (+)' elements,50; giving more context by swapping the reference and target object files.51 52; RUN: llvm-debuginfo-analyzer --attribute=level \53; RUN:                         --compare=types \54; RUN:                         --report=list \55; RUN:                         --print=symbols,types,summary \56; RUN:                         %t.test-clang.o \57; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o 2>&1 | \58; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s59 60; TWO:      Reference: '{{.*}}test-clang.o'61; TWO-NEXT: Target:    'test-dwarf-gcc.o'62; TWO-EMPTY:63; TWO-NEXT: (1) Missing Types:64; TWO-NEXT: -[003]     4     {TypeAlias} 'INTEGER' -> 'int'65; TWO-EMPTY:66; TWO-NEXT: (1) Added Types:67; TWO-NEXT: +[004]     4     {TypeAlias} 'INTEGER' -> 'int'68; TWO-EMPTY:69; TWO-NEXT: ----------------------------------------70; TWO-NEXT: Element   Expected    Missing      Added71; TWO-NEXT: ----------------------------------------72; TWO-NEXT: Scopes           4          0          073; TWO-NEXT: Symbols          0          0          074; TWO-NEXT: Types            2          1          175; TWO-NEXT: Lines            0          0          076; TWO-NEXT: ----------------------------------------77; TWO-NEXT: Total            6          1          178 79; Changing the 'Reference' and 'Target' order:80 81; RUN: llvm-debuginfo-analyzer --attribute=level \82; RUN:                         --compare=types \83; RUN:                         --report=list \84; RUN:                         --print=symbols,types,summary \85; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o \86; RUN:                         %t.test-clang.o 2>&1 | \87; RUN: FileCheck --strict-whitespace -check-prefix=THR %s88 89; THR:      Reference: 'test-dwarf-gcc.o'90; THR-NEXT: Target:    '{{.*}}test-clang.o'91; THR-EMPTY:92; THR-NEXT: (1) Missing Types:93; THR-NEXT: -[004]     4     {TypeAlias} 'INTEGER' -> 'int'94; THR-EMPTY:95; THR-NEXT: (1) Added Types:96; THR-NEXT: +[003]     4     {TypeAlias} 'INTEGER' -> 'int'97; THR-EMPTY:98; THR-NEXT: ----------------------------------------99; THR-NEXT: Element   Expected    Missing      Added100; THR-NEXT: ----------------------------------------101; THR-NEXT: Scopes           4          0          0102; THR-NEXT: Symbols          0          0          0103; THR-NEXT: Types            2          1          1104; THR-NEXT: Lines            0          0          0105; THR-NEXT: ----------------------------------------106; THR-NEXT: Total            6          1          1107