mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 18:06:05 +00:00

Add support for the WebAssembly binary format and be able to generate logical views. https://github.com/llvm/llvm-project/issues/69181 The README.txt includes information about how to build the test cases.
131 lines
5.4 KiB
Plaintext
131 lines
5.4 KiB
Plaintext
; REQUIRES: webassembly-registered-target
|
|
|
|
; Test case 4 - Missing nested enumerations.
|
|
|
|
; pr-46466.cpp
|
|
; 1 struct Struct {
|
|
; 2 union Union {
|
|
; 3 enum NestedEnum { RED, BLUE };
|
|
; 4 };
|
|
; 5 Union U;
|
|
; 6 };
|
|
; 7
|
|
; 8 Struct S;
|
|
; 9 int test() {
|
|
; 10 return S.U.BLUE;
|
|
; 11 }
|
|
|
|
; The above test is used to illustrate a scope issue found in the Clang
|
|
; compiler.
|
|
; PR46466: https://bugs.llvm.org/show_bug.cgi?id=46466
|
|
; PR45811: https://github.com/llvm/llvm-project/issues/45811
|
|
|
|
; In the following logical views, we can see that the DWARF debug
|
|
; information generated by the Clang compiler does not include any
|
|
; references to the enumerators 'RED' and 'BLUE'. The DWARF generated
|
|
; by GCC, does include such references.
|
|
|
|
; RUN: llvm-mc -arch=wasm32 -filetype=obj \
|
|
; RUN: %p/Inputs/pr-46466-clang.s -o %t.pr-46466-clang.o
|
|
|
|
; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
|
|
; RUN: --output-sort=name \
|
|
; RUN: --print=symbols,types \
|
|
; RUN: %t.pr-46466-clang.o \
|
|
; RUN: %p/../DWARF/Inputs/pr-46466-dwarf-gcc.o 2>&1 | \
|
|
; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
|
|
|
|
; ONE: Logical View:
|
|
; ONE-NEXT: [000] {File} '{{.*}}pr-46466-clang.o' -> WASM
|
|
; ONE-EMPTY:
|
|
; ONE-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
|
|
; ONE-NEXT: [002] {Producer} 'clang version 19{{.*}}'
|
|
; ONE-NEXT: [002] 8 {Variable} extern 'S' -> 'Struct'
|
|
; ONE-NEXT: [002] 1 {Struct} 'Struct'
|
|
; ONE-NEXT: [003] 5 {Member} public 'U' -> 'Union'
|
|
; ONE-EMPTY:
|
|
; ONE-NEXT: Logical View:
|
|
; ONE-NEXT: [000] {File} 'pr-46466-dwarf-gcc.o' -> elf64-x86-64
|
|
; ONE-EMPTY:
|
|
; ONE-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
|
|
; ONE-NEXT: [002] {Producer} 'GNU C++14 10.3.0 {{.*}}'
|
|
; ONE-NEXT: [002] 8 {Variable} extern 'S' -> 'Struct'
|
|
; ONE-NEXT: [002] 1 {Struct} 'Struct'
|
|
; ONE-NEXT: [003] 5 {Member} public 'U' -> 'Union'
|
|
; ONE-NEXT: [003] 2 {Union} 'Union'
|
|
; ONE-NEXT: [004] 3 {Enumeration} 'NestedEnum' -> 'unsigned int'
|
|
; ONE-NEXT: [005] {Enumerator} 'BLUE' = '0x1'
|
|
; ONE-NEXT: [005] {Enumerator} 'RED' = '0x0'
|
|
|
|
; Using the selection facilities, we can produce a logical view
|
|
; showing just the logical types that are 'Enumerator' and its
|
|
; parents. The logical view is sorted by the types name.
|
|
|
|
; RUN: llvm-debuginfo-analyzer --attribute=level,format \
|
|
; RUN: --output-sort=name \
|
|
; RUN: --select-types=Enumerator \
|
|
; RUN: --report=parents \
|
|
; RUN: --print=types \
|
|
; RUN: %t.pr-46466-clang.o \
|
|
; RUN: %p/../DWARF/Inputs/pr-46466-dwarf-gcc.o 2>&1 | \
|
|
; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s
|
|
|
|
; TWO: Logical View:
|
|
; TWO-NEXT: [000] {File} '{{.*}}pr-46466-clang.o' -> WASM
|
|
; TWO-EMPTY:
|
|
; TWO-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
|
|
; TWO-EMPTY:
|
|
; TWO-NEXT: Logical View:
|
|
; TWO-NEXT: [000] {File} 'pr-46466-dwarf-gcc.o' -> elf64-x86-64
|
|
; TWO-EMPTY:
|
|
; TWO-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
|
|
; TWO-NEXT: [002] 1 {Struct} 'Struct'
|
|
; TWO-NEXT: [003] 2 {Union} 'Union'
|
|
; TWO-NEXT: [004] 3 {Enumeration} 'NestedEnum' -> 'unsigned int'
|
|
; TWO-NEXT: [005] {Enumerator} 'BLUE' = '0x1'
|
|
; TWO-NEXT: [005] {Enumerator} 'RED' = '0x0'
|
|
|
|
; Using the selection facilities, we can produce a simple tabular output
|
|
; including a summary for the logical types that are 'Enumerator'. The
|
|
; logical view is sorted by the types name.
|
|
|
|
; RUN: llvm-debuginfo-analyzer --attribute=level,format \
|
|
; RUN: --output-sort=name \
|
|
; RUN: --select-types=Enumerator \
|
|
; RUN: --print=types,summary \
|
|
; RUN: %t.pr-46466-clang.o \
|
|
; RUN: %p/../DWARF/Inputs/pr-46466-dwarf-gcc.o 2>&1 | \
|
|
; RUN: FileCheck --strict-whitespace -check-prefix=THR %s
|
|
|
|
; THR: Logical View:
|
|
; THR-NEXT: [000] {File} '{{.*}}pr-46466-clang.o' -> WASM
|
|
; THR-EMPTY:
|
|
; THR-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
|
|
; THR-EMPTY:
|
|
; THR-NEXT: -----------------------------
|
|
; THR-NEXT: Element Total Printed
|
|
; THR-NEXT: -----------------------------
|
|
; THR-NEXT: Scopes 4 0
|
|
; THR-NEXT: Symbols 0 0
|
|
; THR-NEXT: Types 0 0
|
|
; THR-NEXT: Lines 0 0
|
|
; THR-NEXT: -----------------------------
|
|
; THR-NEXT: Total 4 0
|
|
; THR-EMPTY:
|
|
; THR-NEXT: Logical View:
|
|
; THR-NEXT: [000] {File} 'pr-46466-dwarf-gcc.o' -> elf64-x86-64
|
|
; THR-EMPTY:
|
|
; THR-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
|
|
; THR-NEXT: [005] {Enumerator} 'BLUE' = '0x1'
|
|
; THR-NEXT: [005] {Enumerator} 'RED' = '0x0'
|
|
; THR-EMPTY:
|
|
; THR-NEXT: -----------------------------
|
|
; THR-NEXT: Element Total Printed
|
|
; THR-NEXT: -----------------------------
|
|
; THR-NEXT: Scopes 5 0
|
|
; THR-NEXT: Symbols 0 0
|
|
; THR-NEXT: Types 2 2
|
|
; THR-NEXT: Lines 0 0
|
|
; THR-NEXT: -----------------------------
|
|
; THR-NEXT: Total 7 2
|