77 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; Select logical elements.17; The following prints all 'instructions', 'symbols' and 'types' that18; contain 'BLOCK' or '.store' in their names or types, using a tab layout19; and given the number of matches.20 21; RUN: llvm-mc -arch=wasm32 -filetype=obj \22; RUN: %p/Inputs/test-clang.s -o %t.test-clang.o23 24; RUN: llvm-debuginfo-analyzer --attribute=level \25; RUN: --select-nocase --select-regex \26; RUN: --select=BLOCK --select=.store \27; RUN: --report=list \28; RUN: --print=symbols,types,instructions,summary \29; RUN: %t.test-clang.o 2>&1 | \30; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s31 32; ONE: Logical View:33; ONE-NEXT: [000] {File} '{{.*}}test-clang.o'34; ONE-EMPTY:35; ONE-NEXT: [001] {CompileUnit} 'test.cpp'36; ONE-NEXT: [003] {Code} 'block'37; ONE-NEXT: [003] {Code} 'block'38; ONE-NEXT: [004] {Code} 'i32.store 12'39; ONE-NEXT: [003] {Code} 'i32.store 20'40; ONE-NEXT: [003] {Code} 'i32.store 24'41; ONE-NEXT: [004] {Code} 'i32.store 28'42; ONE-NEXT: [003] {Code} 'i32.store 28'43; ONE-NEXT: [003] {Code} 'i32.store8 19'44; ONE-EMPTY:45; ONE-NEXT: -----------------------------46; ONE-NEXT: Element Total Printed47; ONE-NEXT: -----------------------------48; ONE-NEXT: Scopes 3 049; ONE-NEXT: Symbols 4 050; ONE-NEXT: Types 2 051; ONE-NEXT: Lines 62 852; ONE-NEXT: -----------------------------53; ONE-NEXT: Total 71 854 55; RUN: llvm-debuginfo-analyzer --attribute=level \56; RUN: --select-regex --select-nocase \57; RUN: --select=INTe \58; RUN: --report=list \59; RUN: --print=symbols,types \60; RUN: %t.test-clang.o \61; RUN: %p/../DWARF/Inputs/test-dwarf-gcc.o 2>&1 | \62; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s63 64; TWO: Logical View:65; TWO-NEXT: [000] {File} '{{.*}}test-clang.o'66; TWO-EMPTY:67; TWO-NEXT: [001] {CompileUnit} 'test.cpp'68; TWO-NEXT: [003] 4 {TypeAlias} 'INTEGER' -> 'int'69; TWO-NEXT: [004] 5 {Variable} 'CONSTANT' -> 'const INTEGER'70; TWO-EMPTY:71; TWO-NEXT: Logical View:72; TWO-NEXT: [000] {File} 'test-dwarf-gcc.o'73; TWO-EMPTY:74; TWO-NEXT: [001] {CompileUnit} 'test.cpp'75; TWO-NEXT: [004] 4 {TypeAlias} 'INTEGER' -> 'int'76; TWO-NEXT: [004] 5 {Variable} 'CONSTANT' -> 'const INTEGER'77