[llvm] [llvm-debuginfo-analyzer] Add support for WebAssembly binary format. (PR #82588)

Carlos Alberto Enciso via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 08:09:19 PST 2024


https://github.com/CarlosAlbertoEnciso updated https://github.com/llvm/llvm-project/pull/82588

>From 9c9ce3cb5347c31fba5e8ac1480a7525e6d0964f Mon Sep 17 00:00:00 2001
From: Carlos Alberto Enciso <carlos.alberto.enciso at gmail.com>
Date: Thu, 22 Feb 2024 06:00:45 +0000
Subject: [PATCH 1/7] [llvm-debuginfo-analyzer] Add support for WebAssembly
 binary format.

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 and conversion between .wasm and .wat.
---
 .../CommandGuide/llvm-debuginfo-analyzer.rst  | 317 +++++++++++++++++-
 .../LogicalView/Readers/LVBinaryReader.h      |  42 +++
 .../DebugInfo/LogicalView/LVReaderHandler.cpp |   2 +-
 .../LogicalView/Readers/LVBinaryReader.cpp    |  30 ++
 .../LogicalView/Readers/LVELFReader.cpp       |  14 +-
 .../01-wasm-compare-logical-elements.test     | 103 ++++++
 .../01-wasm-print-basic-details.test          | 117 +++++++
 .../01-wasm-select-logical-elements.test      |  74 ++++
 .../WebAssembly/02-wasm-logical-lines.test    |  77 +++++
 ...-wasm-incorrect-lexical-scope-typedef.test | 132 ++++++++
 .../04-wasm-missing-nested-enumerators.test   | 127 +++++++
 ...wasm-incorrect-lexical-scope-variable.test | 111 ++++++
 .../06-wasm-full-logical-view.test            | 155 +++++++++
 .../WebAssembly/Inputs/definitions.h          |  30 ++
 .../WebAssembly/Inputs/hello-world-clang.wasm | Bin 0 -> 1414 bytes
 .../WebAssembly/Inputs/hello-world-clang.wat  |  52 +++
 .../WebAssembly/Inputs/hello-world.cpp        |   7 +
 .../WebAssembly/Inputs/pr-43860-clang.wasm    | Bin 0 -> 1613 bytes
 .../WebAssembly/Inputs/pr-43860-clang.wat     |  75 +++++
 .../WebAssembly/Inputs/pr-43860.cpp           |  15 +
 .../WebAssembly/Inputs/pr-44884-clang.wasm    | Bin 0 -> 1882 bytes
 .../WebAssembly/Inputs/pr-44884-clang.wat     | 149 ++++++++
 .../WebAssembly/Inputs/pr-44884.cpp           |  14 +
 .../WebAssembly/Inputs/pr-46466-clang.wasm    | Bin 0 -> 1180 bytes
 .../WebAssembly/Inputs/pr-46466-clang.wat     |  11 +
 .../WebAssembly/Inputs/pr-46466.cpp           |  11 +
 .../WebAssembly/Inputs/test-clang.wasm        | Bin 0 -> 1459 bytes
 .../WebAssembly/Inputs/test-clang.wat         |  63 ++++
 .../WebAssembly/Inputs/test.cpp               |   9 +
 .../WebAssembly/README.txt                    |  54 +++
 30 files changed, 1785 insertions(+), 6 deletions(-)
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/definitions.h
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wasm
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wat
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world.cpp
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wasm
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wat
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860.cpp
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wasm
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wat
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884.cpp
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wasm
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wat
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466.cpp
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wasm
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wat
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test.cpp
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt

diff --git a/llvm/docs/CommandGuide/llvm-debuginfo-analyzer.rst b/llvm/docs/CommandGuide/llvm-debuginfo-analyzer.rst
index a78066a5eea37e..82fad8ce4d5192 100644
--- a/llvm/docs/CommandGuide/llvm-debuginfo-analyzer.rst
+++ b/llvm/docs/CommandGuide/llvm-debuginfo-analyzer.rst
@@ -16,7 +16,7 @@ DESCRIPTION
 binary object files and prints their contents in a logical view, which
 is a human readable representation that closely matches the structure
 of the original user source code. Supported object file formats include
-ELF, Mach-O, PDB and COFF.
+ELF, Mach-O, WebAssembly, PDB and COFF.
 
 The **logical view** abstracts the complexity associated with the
 different low-level representations of the debugging information that
@@ -468,8 +468,9 @@ If the <pattern> criteria is too general, a more selective option can
 be specified to target a particular category of elements:
 lines (:option:`--select-lines`), scopes (:option:`--select-scopes`),
 symbols (:option:`--select-symbols`) and types (:option:`--select-types`).
+
 These options require knowledge of the debug information format (DWARF,
-CodeView, COFF), as the given **kind** describes a very specific type
+CodeView), as the given **kind** describes a very specific type
 of element.
 
 LINES
@@ -598,7 +599,7 @@ When comparing logical views created from different debug formats, its
 accuracy depends on how close the debug information represents the
 user code. For instance, a logical view created from a binary file with
 DWARF debug information may include more detailed data than a logical
-view created from a binary file with CodeView/COFF debug information.
+view created from a binary file with CodeView debug information.
 
 The following options describe the elements to compare.
 
@@ -1952,6 +1953,316 @@ The **{Coverage}** and **{Location}** attributes describe the debug
 location and coverage for logical symbols. For optimized code, the
 coverage value decreases and it affects the program debuggability.
 
+WEBASSEMBLY SUPPORT
+~~~~~~~~~~~~~~~~~~~
+The below example is used to show the WebAssembly output generated by
+:program:`llvm-debuginfo-analyzer`. We compiled the example for a
+WebAssembly 64-bit target with Clang (-O0 -g --target=wasm64):
+
+.. code-block:: c++
+
+  1  using INTPTR = const int *;
+  2  int foo(INTPTR ParamPtr, unsigned ParamUnsigned, bool ParamBool) {
+  3    if (ParamBool) {
+  4      typedef int INTEGER;
+  5      const INTEGER CONSTANT = 7;
+  6      return CONSTANT;
+  7    }
+  8    return ParamUnsigned;
+  9  }
+
+PRINT BASIC DETAILS
+^^^^^^^^^^^^^^^^^^^
+The following command prints basic details for all the logical elements
+sorted by the debug information internal offset; it includes its lexical
+level and debug info format.
+
+.. code-block:: none
+
+  llvm-debuginfo-analyzer --attribute=level,format
+                          --output-sort=offset
+                          --print=scopes,symbols,types,lines,instructions
+                          test-clang.wasm
+
+or
+
+.. code-block:: none
+
+  llvm-debuginfo-analyzer --attribute=level,format
+                          --output-sort=offset
+                          --print=elements
+                          test-clang.wasm
+
+Each row represents an element that is present within the debug
+information. The first column represents the scope level, followed by
+the associated line number (if any), and finally the description of
+the element.
+
+.. code-block:: none
+
+  Logical View:
+  [000]           {File} 'test-clang.wasm' -> WASM
+
+  [001]             {CompileUnit} 'test.cpp'
+  [002]     2         {Function} extern not_inlined 'foo' -> 'int'
+  [003]     2           {Parameter} 'ParamPtr' -> 'INTPTR'
+  [003]     2           {Parameter} 'ParamUnsigned' -> 'unsigned int'
+  [003]     2           {Parameter} 'ParamBool' -> 'bool'
+  [003]                 {Block}
+  [004]     5             {Variable} 'CONSTANT' -> 'const INTEGER'
+  [004]     5             {Line}
+  [004]                   {Code} 'i32.const	7'
+  [004]                   {Code} 'local.set	10'
+  [004]                   {Code} 'local.get	5'
+  [004]                   {Code} 'local.get	10'
+  [004]                   {Code} 'i32.store	4'
+  [004]     6             {Line}
+  [004]                   {Code} 'i32.const	7'
+  [004]                   {Code} 'local.set	11'
+  [004]                   {Code} 'local.get	5'
+  [004]                   {Code} 'local.get	11'
+  [004]                   {Code} 'i32.store	28'
+  [004]                   {Code} 'br      	1'
+  [004]     -             {Line}
+  [004]                   {Code} 'end'
+  [003]     4           {TypeAlias} 'INTEGER' -> 'int'
+  [003]     2           {Line}
+  [003]                 {Code} 'block   	unknown_type'
+  [003]                 {Code} 'i64.mul'
+  [003]                 {Code} 'throw   	127'
+  [003]                 {Code} 'global.get	0'
+  [003]                 {Code} 'local.set	3'
+  [003]                 {Code} 'i64.const	32'
+  [003]                 {Code} 'local.set	4'
+  [003]                 {Code} 'local.get	3'
+  [003]                 {Code} 'local.get	4'
+  [003]                 {Code} 'i64.sub'
+  [003]                 {Code} 'local.set	5'
+  [003]                 {Code} 'local.get	5'
+  [003]                 {Code} 'local.get	0'
+  [003]                 {Code} 'i64.store	16'
+  [003]                 {Code} 'local.get	5'
+  [003]                 {Code} 'local.get	1'
+  [003]                 {Code} 'i32.store	12'
+  [003]                 {Code} 'local.get	2'
+  [003]                 {Code} 'local.set	6'
+  [003]                 {Code} 'local.get	5'
+  [003]                 {Code} 'local.get	6'
+  [003]                 {Code} 'i32.store8	11'
+  [003]     3           {Line}
+  [003]                 {Code} 'local.get	5'
+  [003]                 {Code} 'i32.load8_u	11'
+  [003]                 {Code} 'local.set	7'
+  [003]     3           {Line}
+  [003]                 {Code} 'i32.const	1'
+  [003]                 {Code} 'local.set	8'
+  [003]                 {Code} 'local.get	7'
+  [003]                 {Code} 'local.get	8'
+  [003]                 {Code} 'i32.and'
+  [003]                 {Code} 'local.set	9'
+  [003]                 {Code} 'block'
+  [003]                 {Code} 'block'
+  [003]                 {Code} 'local.get	9'
+  [003]                 {Code} 'i32.eqz'
+  [003]                 {Code} 'br_if   	0'
+  [003]     8           {Line}
+  [003]                 {Code} 'local.get	5'
+  [003]                 {Code} 'i32.load	12'
+  [003]                 {Code} 'local.set	12'
+  [003]     8           {Line}
+  [003]                 {Code} 'local.get	5'
+  [003]                 {Code} 'local.get	12'
+  [003]                 {Code} 'i32.store	28'
+  [003]     -           {Line}
+  [003]                 {Code} 'end'
+  [003]     9           {Line}
+  [003]                 {Code} 'local.get	5'
+  [003]                 {Code} 'i32.load	28'
+  [003]                 {Code} 'local.set	13'
+  [003]                 {Code} 'local.get	13'
+  [003]                 {Code} 'return'
+  [003]                 {Code} 'end'
+  [003]     9           {Line}
+  [003]                 {Code} 'unreachable'
+  [002]     1         {TypeAlias} 'INTPTR' -> '* const int'
+
+SELECT LOGICAL ELEMENTS
+^^^^^^^^^^^^^^^^^^^^^^^
+The following prints all *instructions*, *symbols* and *types* that
+contain **'block'** or **'.store'** in their names or types, using a tab
+layout and given the number of matches.
+
+.. code-block:: none
+
+  llvm-debuginfo-analyzer --attribute=level
+                          --select-nocase --select-regex
+                          --select=BLOCK --select=.store
+                          --report=list
+                          --print=symbols,types,instructions,summary
+                          test-clang.wasm
+
+  Logical View:
+  [000]           {File} 'test-clang.wasm'
+
+  [001]           {CompileUnit} 'test.cpp'
+  [003]           {Code} 'block'
+  [003]           {Code} 'block'
+  [003]           {Code} 'block   	unknown_type'
+  [003]           {Code} 'i32.store	12'
+  [004]           {Code} 'i32.store	28'
+  [003]           {Code} 'i32.store	28'
+  [004]           {Code} 'i32.store	4'
+  [003]           {Code} 'i32.store8	11'
+  [003]           {Code} 'i64.store	16'
+
+  -----------------------------
+  Element      Total    Printed
+  -----------------------------
+  Scopes           3          0
+  Symbols          4          0
+  Types            2          0
+  Lines           62          9
+  -----------------------------
+  Total           71          9
+
+COMPARISON MODE
+^^^^^^^^^^^^^^^
+Given the previous example we found the above debug information issue
+(related to the previous invalid scope location for the **'typedef int
+INTEGER'**) by comparing against another compiler.
+
+Using GCC to generate test-dwarf-gcc.o, we can apply a selection pattern
+with the printing mode to obtain the following logical view output.
+
+.. code-block:: none
+
+  llvm-debuginfo-analyzer --attribute=level
+                          --select-regex --select-nocase --select=INTe
+                          --report=list
+                          --print=symbols,types
+                          test-clang.wasm test-dwarf-gcc.o
+
+  Logical View:
+  [000]           {File} 'test-clang.wasm'
+
+  [001]           {CompileUnit} 'test.cpp'
+  [003]     4     {TypeAlias} 'INTEGER' -> 'int'
+  [004]     5     {Variable} 'CONSTANT' -> 'const INTEGER'
+
+  Logical View:
+  [000]           {File} 'test-dwarf-gcc.o'
+
+  [001]           {CompileUnit} 'test.cpp'
+  [004]     4     {TypeAlias} 'INTEGER' -> 'int'
+  [004]     5     {Variable} 'CONSTANT' -> 'const INTEGER'
+
+The output shows that both objects contain the same elements. But the
+**'typedef INTEGER'** is located at different scope level. The GCC
+generated object, shows **'4'**, which is the correct value.
+
+There are 2 comparison methods: logical view and logical elements.
+
+LOGICAL VIEW
+""""""""""""
+It compares the logical view as a whole unit; for a match, each compared
+logical element must have the same parents and children.
+
+The output shows in view form the **missing (-), added (+)** elements,
+giving more context by swapping the reference and target object files.
+
+.. code-block:: none
+
+  llvm-debuginfo-analyzer --attribute=level
+                          --compare=types
+                          --report=view
+                          --print=symbols,types
+                          test-clang.wasm test-dwarf-gcc.o
+
+  Reference: 'test-clang.wasm'
+  Target:    'test-dwarf-gcc.o'
+
+  Logical View:
+   [000]           {File} 'test-clang.wasm'
+
+   [001]             {CompileUnit} 'test.cpp'
+   [002]     1         {TypeAlias} 'INTPTR' -> '* const int'
+   [002]     2         {Function} extern not_inlined 'foo' -> 'int'
+   [003]                 {Block}
+   [004]     5             {Variable} 'CONSTANT' -> 'const INTEGER'
+  +[004]     4             {TypeAlias} 'INTEGER' -> 'int'
+   [003]     2           {Parameter} 'ParamBool' -> 'bool'
+   [003]     2           {Parameter} 'ParamPtr' -> 'INTPTR'
+   [003]     2           {Parameter} 'ParamUnsigned' -> 'unsigned int'
+  -[003]     4           {TypeAlias} 'INTEGER' -> 'int'
+
+The output shows the merging view path (reference and target) with the
+missing and added elements.
+
+LOGICAL ELEMENTS
+""""""""""""""""
+It compares individual logical elements without considering if their
+parents are the same. For both comparison methods, the equal criteria
+includes the name, source code location, type, lexical scope level.
+
+.. code-block:: none
+
+  llvm-debuginfo-analyzer --attribute=level
+                          --compare=types
+                          --report=list
+                          --print=symbols,types,summary
+                          test-clang.wasm test-dwarf-gcc.o
+
+  Reference: 'test-clang.wasm'
+  Target:    'test-dwarf-gcc.o'
+
+  (1) Missing Types:
+  -[003]     4     {TypeAlias} 'INTEGER' -> 'int'
+
+  (1) Added Types:
+  +[004]     4     {TypeAlias} 'INTEGER' -> 'int'
+
+  ----------------------------------------
+  Element   Expected    Missing      Added
+  ----------------------------------------
+  Scopes           4          0          0
+  Symbols          0          0          0
+  Types            2          1          1
+  Lines            0          0          0
+  ----------------------------------------
+  Total            6          1          1
+
+Changing the *Reference* and *Target* order:
+
+.. code-block:: none
+
+  llvm-debuginfo-analyzer --attribute=level
+                          --compare=types
+                          --report=list
+                          --print=symbols,types,summary
+                          test-dwarf-gcc.o test-clang.wasm
+
+  Reference: 'test-dwarf-gcc.o'
+  Target:    'test-clang.wasm'
+
+  (1) Missing Types:
+  -[004]     4     {TypeAlias} 'INTEGER' -> 'int'
+
+  (1) Added Types:
+  +[003]     4     {TypeAlias} 'INTEGER' -> 'int'
+
+  ----------------------------------------
+  Element   Expected    Missing      Added
+  ----------------------------------------
+  Scopes           4          0          0
+  Symbols          0          0          0
+  Types            2          1          1
+  Lines            0          0          0
+  ----------------------------------------
+  Total            6          1          1
+
+As the *Reference* and *Target* are switched, the *Added Types* from
+the first case now are listed as *Missing Types*.
+
 EXIT STATUS
 -----------
 :program:`llvm-debuginfo-analyzer` returns 0 if the input files were
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h
index a66cf4608823be..f62ae25c10f6db 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h
@@ -122,6 +122,48 @@ class LVBinaryReader : public LVReader {
   std::unique_ptr<MCContext> MC;
   std::unique_ptr<MCInstPrinter> MIP;
 
+  // https://yurydelendik.github.io/webassembly-dwarf/
+  // 2. Consuming and Generating DWARF for WebAssembly Code
+  // Note: Some DWARF constructs don't map one-to-one onto WebAssembly
+  // constructs. We strive to enumerate and resolve any ambiguities here.
+  //
+  // 2.1. Code Addresses
+  // Note: DWARF associates various bits of debug info
+  // with particular locations in the program via its code address (instruction
+  // pointer or PC). However, WebAssembly's linear memory address space does not
+  // contain WebAssembly instructions.
+  //
+  // Wherever a code address (see 2.17 of [DWARF]) is used in DWARF for
+  // WebAssembly, it must be the offset of an instruction relative within the
+  // Code section of the WebAssembly file. The DWARF is considered malformed if
+  // a PC offset is between instruction boundaries within the Code section.
+  //
+  // Note: It is expected that a DWARF consumer does not know how to decode
+  // WebAssembly instructions. The instruction pointer is selected as the offset
+  // in the binary file of the first byte of the instruction, and it is
+  // consistent with the WebAssembly Web API conventions definition of the code
+  // location.
+  //
+  // EXAMPLE: .DEBUG_LINE INSTRUCTION POINTERS
+  // The .debug_line DWARF section maps instruction pointers to source
+  // locations. With WebAssembly, the .debug_line section maps Code
+  // section-relative instruction offsets to source locations.
+  //
+  //  EXAMPLE: DW_AT_* ATTRIBUTES
+  // For entities with a single associated code address, DWARF uses
+  // the DW_AT_low_pc attribute to specify the associated code address value.
+  // For WebAssembly, the DW_AT_low_pc's value is a Code section-relative
+  // instruction offset.
+  //
+  // For entities with a single contiguous range of code, DWARF uses a
+  // pair of DW_AT_low_pc and DW_AT_high_pc attributes to specify the associated
+  // contiguous range of code address values. For WebAssembly, these attributes
+  // are Code section-relative instruction offsets.
+  //
+  // For entities with multiple ranges of code, DWARF uses the DW_AT_ranges
+  // attribute, which refers to the array located at the .debug_ranges section.
+  LVAddress WasmOffset = 0;
+
   // Loads all info for the architecture of the provided object file.
   Error loadGenericTargetInfo(StringRef TheTriple, StringRef TheFeatures);
 
diff --git a/llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp b/llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp
index 5f82f816dc19d5..16c4fbed1423fb 100644
--- a/llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp
@@ -48,7 +48,7 @@ Error LVReaderHandler::createReader(StringRef Filename, LVReaders &Readers,
         return std::make_unique<LVCodeViewReader>(Filename, FileFormatName,
                                                   *COFF, W, ExePath);
       }
-      if (Obj.isELF() || Obj.isMachO())
+      if (Obj.isELF() || Obj.isMachO() || Obj.isWasm())
         return std::make_unique<LVELFReader>(Filename, FileFormatName, Obj, W);
     }
     if (isa<PDBFile *>(Input)) {
diff --git a/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp b/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp
index a0cd8b7839cf7a..d219b8abe1ae98 100644
--- a/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp
@@ -146,6 +146,30 @@ bool LVBinaryReader::getSymbolTableIsComdat(StringRef Name) {
 
 void LVBinaryReader::mapVirtualAddress(const object::ObjectFile &Obj) {
   for (const object::SectionRef &Section : Obj.sections()) {
+    LLVM_DEBUG({
+      Expected<StringRef> SectionNameOrErr = Section.getName();
+      StringRef Name;
+      if (!SectionNameOrErr)
+        consumeError(SectionNameOrErr.takeError());
+      else
+        Name = *SectionNameOrErr;
+      dbgs() << "Index: " << format_decimal(Section.getIndex(), 3) << ", "
+             << "Address: " << hexValue(Section.getAddress()) << ", "
+             << "Size: " << hexValue(Section.getSize()) << ", "
+             << "Name: " << Name << "\n";
+      dbgs() << "isCompressed:   " << Section.isCompressed() << ", "
+             << "isText:         " << Section.isText() << ", "
+             << "isData:         " << Section.isData() << ", "
+             << "isBSS:          " << Section.isBSS() << ", "
+             << "isVirtual:      " << Section.isVirtual() << "\n";
+      dbgs() << "isBitcode:      " << Section.isBitcode() << ", "
+             << "isStripped:     " << Section.isStripped() << ", "
+             << "isBerkeleyText: " << Section.isBerkeleyText() << ", "
+             << "isBerkeleyData: " << Section.isBerkeleyData() << ", "
+             << "isDebugSection: " << Section.isDebugSection() << "\n";
+      dbgs() << "\n";
+    });
+
     if (!Section.isText() || Section.isVirtual() || !Section.getSize())
       continue;
 
@@ -161,8 +185,14 @@ void LVBinaryReader::mapVirtualAddress(const object::ObjectFile &Obj) {
       continue;
     }
     if ((*SectionNameOrErr).equals(".text") ||
+        (*SectionNameOrErr).equals("CODE") ||
         (*SectionNameOrErr).equals(".code"))
       DotTextSectionIndex = Section.getIndex();
+      // If the object is WebAssembly, update the address offset that
+      // will be added to DWARF DW_AT_* attributes.
+      if (Obj.isWasm()) {
+        WasmOffset = Section.getAddress();
+      }
   }
 
   // Process the symbol table.
diff --git a/llvm/lib/DebugInfo/LogicalView/Readers/LVELFReader.cpp b/llvm/lib/DebugInfo/LogicalView/Readers/LVELFReader.cpp
index 4469092099daca..79428357fa26c1 100644
--- a/llvm/lib/DebugInfo/LogicalView/Readers/LVELFReader.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/Readers/LVELFReader.cpp
@@ -415,6 +415,8 @@ void LVELFReader::processOneAttribute(const DWARFDie &Die, LVOffset *OffsetPtr,
       if (FoundLowPC) {
         if (CurrentLowPC == MaxAddress)
           CurrentElement->setIsDiscarded();
+        // Consider the case of WebAssembly.
+        CurrentLowPC += WasmOffset;
         if (CurrentElement->isCompileUnit())
           setCUBaseAddress(CurrentLowPC);
       }
@@ -429,10 +431,14 @@ void LVELFReader::processOneAttribute(const DWARFDie &Die, LVOffset *OffsetPtr,
         CurrentHighPC = *Address;
       if (std::optional<uint64_t> Offset = FormValue.getAsUnsignedConstant())
         // High PC is an offset from LowPC.
-        CurrentHighPC = CurrentLowPC + *Offset;
+        // Don't add the WebAssembly offset if we have seen a DW_AT_low_pc.
+        CurrentHighPC =
+            (FoundLowPC ? CurrentLowPC - WasmOffset : CurrentLowPC) + *Offset;
       // Store the real upper limit for the address range.
       if (UpdateHighAddress && CurrentHighPC > 0)
         --CurrentHighPC;
+      // Consider the case of WebAssembly.
+      CurrentHighPC += WasmOffset;
       if (CurrentElement->isCompileUnit())
         setCUHighAddress(CurrentHighPC);
     }
@@ -466,6 +472,9 @@ void LVELFReader::processOneAttribute(const DWARFDie &Die, LVOffset *OffsetPtr,
         // Store the real upper limit for the address range.
         if (UpdateHighAddress && Range.HighPC > 0)
           --Range.HighPC;
+        // Consider the case of WebAssembly.
+        Range.LowPC += WasmOffset;
+        Range.HighPC += WasmOffset;
         // Add the pair of addresses.
         CurrentScope->addObject(Range.LowPC, Range.HighPC);
         // If the scope is the CU, do not update the ranges set.
@@ -735,7 +744,8 @@ void LVELFReader::createLineAndFileRecords(
       // and they will be released when its scope parent is deleted.
       LVLineDebug *Line = createLineDebug();
       CULines.push_back(Line);
-      Line->setAddress(Row.Address.Address);
+      // Consider the case of WebAssembly.
+      Line->setAddress(Row.Address.Address + WasmOffset);
       Line->setFilename(
           CompileUnit->getFilename(IncrementIndex ? Row.File + 1 : Row.File));
       Line->setLineNumber(Row.Line);
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test
new file mode 100644
index 00000000000000..4194fd89dd5dfe
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test
@@ -0,0 +1,103 @@
+; REQUIRES: webassembly-registered-target
+
+; Test case 1 - General options
+
+; test.cpp
+;  1  using INTPTR = const int *;
+;  2  int foo(INTPTR ParamPtr, unsigned ParamUnsigned, bool ParamBool) {
+;  3    if (ParamBool) {
+;  4      typedef int INTEGER;
+;  5      const INTEGER CONSTANT = 7;
+;  6      return CONSTANT;
+;  7    }
+;  8    return ParamUnsigned;
+;  9  }
+
+; Compare mode - Logical view.
+; The output shows in view form the 'missing (-), added (+)' elements,
+; giving more context by swapping the reference and target object files.
+
+; RUN: llvm-debuginfo-analyzer --attribute=level \
+; RUN:                         --compare=types \
+; RUN:                         --report=view \
+; RUN:                         --print=symbols,types \
+; RUN:                         %p/Inputs/test-clang.wasm \
+; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o 2>&1 | \
+; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
+
+; ONE:      Reference: 'test-clang.wasm'
+; ONE-NEXT: Target:    'test-dwarf-gcc.o'
+; ONE-EMPTY:
+; ONE-NEXT: Logical View:
+; ONE-NEXT:  [000]           {File} 'test-clang.wasm'
+; ONE-EMPTY:
+; ONE-NEXT:  [001]             {CompileUnit} 'test.cpp'
+; ONE-NEXT:  [002]     1         {TypeAlias} 'INTPTR' -> '* const int'
+; ONE-NEXT:  [002]     2         {Function} extern not_inlined 'foo' -> 'int'
+; ONE-NEXT:  [003]                 {Block}
+; ONE-NEXT:  [004]     5             {Variable} 'CONSTANT' -> 'const INTEGER'
+; ONE-NEXT: +[004]     4             {TypeAlias} 'INTEGER' -> 'int'
+; ONE-NEXT:  [003]     2           {Parameter} 'ParamBool' -> 'bool'
+; ONE-NEXT:  [003]     2           {Parameter} 'ParamPtr' -> 'INTPTR'
+; ONE-NEXT:  [003]     2           {Parameter} 'ParamUnsigned' -> 'unsigned int'
+; ONE-NEXT: -[003]     4           {TypeAlias} 'INTEGER' -> 'int'
+
+; Compare mode - Logical elements.
+; The output shows in tabular form the 'missing (-), added (+)' elements,
+; giving more context by swapping the reference and target object files.
+
+; RUN: llvm-debuginfo-analyzer --attribute=level \
+; RUN:                         --compare=types \
+; RUN:                         --report=list \
+; RUN:                         --print=symbols,types,summary \
+; RUN:                         %p/Inputs/test-clang.wasm \
+; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o 2>&1 | \
+; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s
+
+; TWO:      Reference: 'test-clang.wasm'
+; TWO-NEXT: Target:    'test-dwarf-gcc.o'
+; TWO-EMPTY:
+; TWO-NEXT: (1) Missing Types:
+; TWO-NEXT: -[003]     4     {TypeAlias} 'INTEGER' -> 'int'
+; TWO-EMPTY:
+; TWO-NEXT: (1) Added Types:
+; TWO-NEXT: +[004]     4     {TypeAlias} 'INTEGER' -> 'int'
+; TWO-EMPTY:
+; TWO-NEXT: ----------------------------------------
+; TWO-NEXT: Element   Expected    Missing      Added
+; TWO-NEXT: ----------------------------------------
+; TWO-NEXT: Scopes           4          0          0
+; TWO-NEXT: Symbols          0          0          0
+; TWO-NEXT: Types            2          1          1
+; TWO-NEXT: Lines            0          0          0
+; TWO-NEXT: ----------------------------------------
+; TWO-NEXT: Total            6          1          1
+
+; Changing the 'Reference' and 'Target' order:
+
+; RUN: llvm-debuginfo-analyzer --attribute=level \
+; RUN:                         --compare=types \
+; RUN:                         --report=list \
+; RUN:                         --print=symbols,types,summary \
+; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o \
+; RUN:                         %p/Inputs/test-clang.wasm 2>&1 | \
+; RUN: FileCheck --strict-whitespace -check-prefix=THR %s
+
+; THR:      Reference: 'test-dwarf-gcc.o'
+; THR-NEXT: Target:    'test-clang.wasm'
+; THR-EMPTY:
+; THR-NEXT: (1) Missing Types:
+; THR-NEXT: -[004]     4     {TypeAlias} 'INTEGER' -> 'int'
+; THR-EMPTY:
+; THR-NEXT: (1) Added Types:
+; THR-NEXT: +[003]     4     {TypeAlias} 'INTEGER' -> 'int'
+; THR-EMPTY:
+; THR-NEXT: ----------------------------------------
+; THR-NEXT: Element   Expected    Missing      Added
+; THR-NEXT: ----------------------------------------
+; THR-NEXT: Scopes           4          0          0
+; THR-NEXT: Symbols          0          0          0
+; THR-NEXT: Types            2          1          1
+; THR-NEXT: Lines            0          0          0
+; THR-NEXT: ----------------------------------------
+; THR-NEXT: Total            6          1          1
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
new file mode 100644
index 00000000000000..10b44028bfbfb9
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
@@ -0,0 +1,117 @@
+; REQUIRES: webassembly-registered-target
+
+; Test case 1 - General options.
+
+; test.cpp
+;  1  using INTPTR = const int *;
+;  2  int foo(INTPTR ParamPtr, unsigned ParamUnsigned, bool ParamBool) {
+;  3    if (ParamBool) {
+;  4      typedef int INTEGER;
+;  5      const INTEGER CONSTANT = 7;
+;  6      return CONSTANT;
+;  7    }
+;  8    return ParamUnsigned;
+;  9  }
+
+; Print basic details.
+; The following command prints basic details for all the logical elements
+; sorted by the debug information internal offset; it includes its lexical
+; level and debug info format.
+
+; RUN: llvm-debuginfo-analyzer --attribute=level,format \
+; RUN:                         --output-sort=offset \
+; RUN:                         --print=scopes,symbols,types,lines,instructions \
+; RUN:                         %p/Inputs/test-clang.wasm 2>&1 | \
+; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
+
+; RUN: llvm-debuginfo-analyzer --attribute=level,format \
+; RUN:                         --output-sort=offset \
+; RUN:                         --print=elements \
+; RUN:                         %p/Inputs/test-clang.wasm 2>&1 | \
+; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
+
+; ONE:      Logical View:
+; ONE-NEXT: [000]           {File} 'test-clang.wasm' -> WASM
+; ONE-EMPTY:
+; ONE-NEXT: [001]             {CompileUnit} 'test.cpp'
+; ONE-NEXT: [002]     2         {Function} extern not_inlined 'foo' -> 'int'
+; ONE-NEXT: [003]     2           {Parameter} 'ParamPtr' -> 'INTPTR'
+; ONE-NEXT: [003]     2           {Parameter} 'ParamUnsigned' -> 'unsigned int'
+; ONE-NEXT: [003]     2           {Parameter} 'ParamBool' -> 'bool'
+; ONE-NEXT: [003]                 {Block}
+; ONE-NEXT: [004]     5             {Variable} 'CONSTANT' -> 'const INTEGER'
+; ONE-NEXT: [004]     5             {Line}
+; ONE-NEXT: [004]                   {Code} 'i32.const	7'
+; ONE-NEXT: [004]                   {Code} 'local.set	10'
+; ONE-NEXT: [004]                   {Code} 'local.get	5'
+; ONE-NEXT: [004]                   {Code} 'local.get	10'
+; ONE-NEXT: [004]                   {Code} 'i32.store	4'
+; ONE-NEXT: [004]     6             {Line}
+; ONE-NEXT: [004]                   {Code} 'i32.const	7'
+; ONE-NEXT: [004]                   {Code} 'local.set	11'
+; ONE-NEXT: [004]                   {Code} 'local.get	5'
+; ONE-NEXT: [004]                   {Code} 'local.get	11'
+; ONE-NEXT: [004]                   {Code} 'i32.store	28'
+; ONE-NEXT: [004]                   {Code} 'br      	1'
+; ONE-NEXT: [004]     -             {Line}
+; ONE-NEXT: [004]                   {Code} 'end'
+; ONE-NEXT: [003]     4           {TypeAlias} 'INTEGER' -> 'int'
+; ONE-NEXT: [003]     2           {Line}
+; ONE-NEXT: [003]                 {Code} 'block   	unknown_type'
+; ONE-NEXT: [003]                 {Code} 'i64.mul'
+; ONE-NEXT: [003]                 {Code} 'throw   	127'
+; ONE-NEXT: [003]                 {Code} 'global.get	0'
+; ONE-NEXT: [003]                 {Code} 'local.set	3'
+; ONE-NEXT: [003]                 {Code} 'i64.const	32'
+; ONE-NEXT: [003]                 {Code} 'local.set	4'
+; ONE-NEXT: [003]                 {Code} 'local.get	3'
+; ONE-NEXT: [003]                 {Code} 'local.get	4'
+; ONE-NEXT: [003]                 {Code} 'i64.sub'
+; ONE-NEXT: [003]                 {Code} 'local.set	5'
+; ONE-NEXT: [003]                 {Code} 'local.get	5'
+; ONE-NEXT: [003]                 {Code} 'local.get	0'
+; ONE-NEXT: [003]                 {Code} 'i64.store	16'
+; ONE-NEXT: [003]                 {Code} 'local.get	5'
+; ONE-NEXT: [003]                 {Code} 'local.get	1'
+; ONE-NEXT: [003]                 {Code} 'i32.store	12'
+; ONE-NEXT: [003]                 {Code} 'local.get	2'
+; ONE-NEXT: [003]                 {Code} 'local.set	6'
+; ONE-NEXT: [003]                 {Code} 'local.get	5'
+; ONE-NEXT: [003]                 {Code} 'local.get	6'
+; ONE-NEXT: [003]                 {Code} 'i32.store8	11'
+; ONE-NEXT: [003]     3           {Line}
+; ONE-NEXT: [003]                 {Code} 'local.get	5'
+; ONE-NEXT: [003]                 {Code} 'i32.load8_u	11'
+; ONE-NEXT: [003]                 {Code} 'local.set	7'
+; ONE-NEXT: [003]     3           {Line}
+; ONE-NEXT: [003]                 {Code} 'i32.const	1'
+; ONE-NEXT: [003]                 {Code} 'local.set	8'
+; ONE-NEXT: [003]                 {Code} 'local.get	7'
+; ONE-NEXT: [003]                 {Code} 'local.get	8'
+; ONE-NEXT: [003]                 {Code} 'i32.and'
+; ONE-NEXT: [003]                 {Code} 'local.set	9'
+; ONE-NEXT: [003]                 {Code} 'block'
+; ONE-NEXT: [003]                 {Code} 'block'
+; ONE-NEXT: [003]                 {Code} 'local.get	9'
+; ONE-NEXT: [003]                 {Code} 'i32.eqz'
+; ONE-NEXT: [003]                 {Code} 'br_if   	0'
+; ONE-NEXT: [003]     8           {Line}
+; ONE-NEXT: [003]                 {Code} 'local.get	5'
+; ONE-NEXT: [003]                 {Code} 'i32.load	12'
+; ONE-NEXT: [003]                 {Code} 'local.set	12'
+; ONE-NEXT: [003]     8           {Line}
+; ONE-NEXT: [003]                 {Code} 'local.get	5'
+; ONE-NEXT: [003]                 {Code} 'local.get	12'
+; ONE-NEXT: [003]                 {Code} 'i32.store	28'
+; ONE-NEXT: [003]     -           {Line}
+; ONE-NEXT: [003]                 {Code} 'end'
+; ONE-NEXT: [003]     9           {Line}
+; ONE-NEXT: [003]                 {Code} 'local.get	5'
+; ONE-NEXT: [003]                 {Code} 'i32.load	28'
+; ONE-NEXT: [003]                 {Code} 'local.set	13'
+; ONE-NEXT: [003]                 {Code} 'local.get	13'
+; ONE-NEXT: [003]                 {Code} 'return'
+; ONE-NEXT: [003]                 {Code} 'end'
+; ONE-NEXT: [003]     9           {Line}
+; ONE-NEXT: [003]                 {Code} 'unreachable'
+; ONE-NEXT: [002]     1         {TypeAlias} 'INTPTR' -> '* const int'
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
new file mode 100644
index 00000000000000..44602dc7ac2cec
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
@@ -0,0 +1,74 @@
+; REQUIRES: webassembly-registered-target
+
+; Test case 1 - General options
+
+; test.cpp
+;  1  using INTPTR = const int *;
+;  2  int foo(INTPTR ParamPtr, unsigned ParamUnsigned, bool ParamBool) {
+;  3    if (ParamBool) {
+;  4      typedef int INTEGER;
+;  5      const INTEGER CONSTANT = 7;
+;  6      return CONSTANT;
+;  7    }
+;  8    return ParamUnsigned;
+;  9  }
+
+; Select logical elements.
+; The following prints all 'instructions', 'symbols' and 'types' that
+; contain 'BLOCK' or '.store' in their names or types, using a tab layout
+; and given the number of matches.
+
+; RUN: llvm-debuginfo-analyzer --attribute=level \
+; RUN:                         --select-nocase --select-regex \
+; RUN:                         --select=BLOCK --select=.store \
+; RUN:                         --report=list \
+; RUN:                         --print=symbols,types,instructions,summary \
+; RUN:                         %p/Inputs/test-clang.wasm 2>&1 | \
+; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
+
+; ONE:      Logical View:
+; ONE-NEXT: [000]           {File} 'test-clang.wasm'
+; ONE-EMPTY:
+; ONE-NEXT: [001]           {CompileUnit} 'test.cpp'
+; ONE-NEXT: [003]           {Code} 'block'
+; ONE-NEXT: [003]           {Code} 'block'
+; ONE-NEXT: [003]           {Code} 'block   	unknown_type'
+; ONE-NEXT: [003]           {Code} 'i32.store	12'
+; ONE-NEXT: [004]           {Code} 'i32.store	28'
+; ONE-NEXT: [003]           {Code} 'i32.store	28'
+; ONE-NEXT: [004]           {Code} 'i32.store	4'
+; ONE-NEXT: [003]           {Code} 'i32.store8	11'
+; ONE-NEXT: [003]           {Code} 'i64.store	16'
+; ONE-EMPTY:
+; ONE-NEXT: -----------------------------
+; ONE-NEXT: Element      Total    Printed
+; ONE-NEXT: -----------------------------
+; ONE-NEXT: Scopes           3          0
+; ONE-NEXT: Symbols          4          0
+; ONE-NEXT: Types            2          0
+; ONE-NEXT: Lines           62          9
+; ONE-NEXT: -----------------------------
+; ONE-NEXT: Total           71          9
+
+; RUN: llvm-debuginfo-analyzer --attribute=level \
+; RUN:                         --select-regex --select-nocase \
+; RUN:                         --select=INTe \
+; RUN:                         --report=list \
+; RUN:                         --print=symbols,types \
+; RUN:                         %p/Inputs/test-clang.wasm \
+; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o 2>&1 | \
+; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s
+
+; TWO:      Logical View:
+; TWO-NEXT: [000]           {File} 'test-clang.wasm'
+; TWO-EMPTY:
+; TWO-NEXT: [001]           {CompileUnit} 'test.cpp'
+; TWO-NEXT: [003]     4     {TypeAlias} 'INTEGER' -> 'int'
+; TWO-NEXT: [004]     5     {Variable} 'CONSTANT' -> 'const INTEGER'
+; TWO-EMPTY:
+; TWO-NEXT: Logical View:
+; TWO-NEXT: [000]           {File} 'test-dwarf-gcc.o'
+; TWO-EMPTY:
+; TWO-NEXT: [001]           {CompileUnit} 'test.cpp'
+; TWO-NEXT: [004]     4     {TypeAlias} 'INTEGER' -> 'int'
+; TWO-NEXT: [004]     5     {Variable} 'CONSTANT' -> 'const INTEGER'
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
new file mode 100644
index 00000000000000..af55d7812115a6
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
@@ -0,0 +1,77 @@
+; REQUIRES: webassembly-registered-target
+
+; Test case 2 - Assembler instructions.
+
+; hello-world.cpp
+;  1  extern int printf(const char * format, ... );
+;  2
+;  3  int main()
+;  4  {
+;  5    printf("Hello, World\n");
+;  6    return 0;
+;  7  }
+
+; Logical lines.
+; The logical views shows the intermixed lines and assembler instructions,
+; allowing to compare the code generated by the different toolchains.
+
+; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
+; RUN:                         --print=lines,instructions \
+; RUN:                         %p/Inputs/hello-world-clang.wasm 2>&1 | \
+; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
+
+; ONE:      Logical View:
+; ONE-NEXT: [000]           {File} 'hello-world-clang.wasm' -> WASM
+; ONE-EMPTY:
+; ONE-NEXT: [001]             {CompileUnit} 'hello-world.cpp'
+; ONE-NEXT: [002]               {Producer} 'clang version 19{{.*}}'
+; ONE-NEXT: [002]     3         {Function} extern not_inlined 'main' -> 'int'
+; ONE-NEXT: [003]     4           {Line}
+; ONE-NEXT: [003]                 {Code} 'else'
+; ONE-NEXT: [003]                 {Code} 'loop    	i64'
+; ONE-NEXT: [003]                 {Code} 'nop'
+; ONE-NEXT: [003]                 {Code} 'i64.div_s'
+; ONE-NEXT: [003]                 {Code} 'block   	i64'
+; ONE-NEXT: [003]                 {Code} 'nop'
+; ONE-NEXT: [003]                 {Code} 'i64.div_s'
+; ONE-NEXT: [003]                 {Code} 'block   	i64'
+; ONE-NEXT: [003]                 {Code} 'global.get	0'
+; ONE-NEXT: [003]                 {Code} 'local.set	0'
+; ONE-NEXT: [003]                 {Code} 'i64.const	16'
+; ONE-NEXT: [003]                 {Code} 'local.set	1'
+; ONE-NEXT: [003]                 {Code} 'local.get	0'
+; ONE-NEXT: [003]                 {Code} 'local.get	1'
+; ONE-NEXT: [003]                 {Code} 'i64.sub'
+; ONE-NEXT: [003]                 {Code} 'local.set	2'
+; ONE-NEXT: [003]                 {Code} 'local.get	2'
+; ONE-NEXT: [003]                 {Code} 'global.set	0'
+; ONE-NEXT: [003]                 {Code} 'i32.const	0'
+; ONE-NEXT: [003]                 {Code} 'local.set	3'
+; ONE-NEXT: [003]                 {Code} 'local.get	2'
+; ONE-NEXT: [003]                 {Code} 'local.get	3'
+; ONE-NEXT: [003]                 {Code} 'i32.store	12'
+; ONE-NEXT: [003]     5           {Line}
+; ONE-NEXT: [003]                 {Code} 'i64.const	0'
+; ONE-NEXT: [003]                 {Code} 'local.set	4'
+; ONE-NEXT: [003]                 {Code} 'i64.const	0'
+; ONE-NEXT: [003]                 {Code} 'local.set	5'
+; ONE-NEXT: [003]                 {Code} 'local.get	4'
+; ONE-NEXT: [003]                 {Code} 'local.get	5'
+; ONE-NEXT: [003]                 {Code} 'call	0'
+; ONE-NEXT: [003]                 {Code} 'drop'
+; ONE-NEXT: [003]     6           {Line}
+; ONE-NEXT: [003]                 {Code} 'i32.const	0'
+; ONE-NEXT: [003]                 {Code} 'local.set	6'
+; ONE-NEXT: [003]                 {Code} 'i64.const	16'
+; ONE-NEXT: [003]                 {Code} 'local.set	7'
+; ONE-NEXT: [003]                 {Code} 'local.get	2'
+; ONE-NEXT: [003]                 {Code} 'local.get	7'
+; ONE-NEXT: [003]                 {Code} 'i64.add'
+; ONE-NEXT: [003]                 {Code} 'local.set	8'
+; ONE-NEXT: [003]                 {Code} 'local.get	8'
+; ONE-NEXT: [003]                 {Code} 'global.set	0'
+; ONE-NEXT: [003]                 {Code} 'local.get	6'
+; ONE-NEXT: [003]                 {Code} 'return'
+; ONE-NEXT: [003]                 {Code} 'end'
+; ONE-NEXT: [003]     6           {Line}
+; ONE-NEXT: [003]                 {Code} 'return'
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test
new file mode 100644
index 00000000000000..8902a5168834ab
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test
@@ -0,0 +1,132 @@
+; REQUIRES: webassembly-registered-target
+
+; Test case 3 - Incorrect lexical scope for typedef.
+
+; pr-44884.cpp
+;  1  int bar(float Input) { return (int)Input; }
+;  2
+;  3  unsigned foo(char Param) {
+;  4    typedef int INT;                // ** Definition for INT **
+;  5    INT Value = Param;
+;  6    {
+;  7      typedef float FLOAT;          // ** Definition for FLOAT **
+;  8      {
+;  9        FLOAT Added = Value + Param;
+; 10        Value = bar(Added);
+; 11      }
+; 12    }
+; 13    return Value + Param;
+; 14  }
+
+; The lines 4 and 7 contains 2 typedefs, defined at different lexical
+; scopes.
+
+; The above test is used to illustrates a scope issue found in the
+; Clang compiler.
+; PR44884: https://bugs.llvm.org/show_bug.cgi?id=44884
+; PR44229: https://github.com/llvm/llvm-project/issues/44229
+
+; In the following logical views, we can see that the Clang compiler
+; emits both typedefs at the same lexical scope (3), which is wrong.
+; GCC emit correct lexical scope for both typedefs.
+
+; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
+; RUN:                         --output-sort=kind \
+; RUN:                         --print=symbols,types,lines \
+; RUN:                         %p/Inputs/pr-44884-clang.wasm \
+; RUN:                         %p/../DWARF/Inputs/pr-44884-dwarf-gcc.o 2>&1 | \
+; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
+
+; ONE:      Logical View:
+; ONE-NEXT: [000]           {File} 'pr-44884-clang.wasm' -> WASM
+; ONE-EMPTY:
+; ONE-NEXT: [001]             {CompileUnit} 'pr-44884.cpp'
+; ONE-NEXT: [002]               {Producer} 'clang version 19{{.*}}'
+; ONE-NEXT: [002]     1         {Function} extern not_inlined 'bar' -> 'int'
+; ONE-NEXT: [003]     1           {Parameter} 'Input' -> 'float'
+; ONE-NEXT: [003]     1           {Line}
+; ONE-NEXT: [003]     1           {Line}
+; ONE-NEXT: [003]     -           {Line}
+; ONE-NEXT: [003]     1           {Line}
+; ONE-NEXT: [003]     -           {Line}
+; ONE-NEXT: [003]     1           {Line}
+; ONE-NEXT: [003]     1           {Line}
+; ONE-NEXT: [003]     1           {Line}
+; ONE-NEXT: [002]     3         {Function} extern not_inlined 'foo' -> 'unsigned int'
+; ONE-NEXT: [003]                 {Block}
+; ONE-NEXT: [004]     9             {Variable} 'Added' -> 'FLOAT'
+; ONE-NEXT: [004]     9             {Line}
+; ONE-NEXT: [004]     9             {Line}
+; ONE-NEXT: [004]     9             {Line}
+; ONE-NEXT: [004]     9             {Line}
+; ONE-NEXT: [004]     9             {Line}
+; ONE-NEXT: [004]    10             {Line}
+; ONE-NEXT: [004]    10             {Line}
+; ONE-NEXT: [004]    10             {Line}
+; ONE-NEXT: [004]    13             {Line}
+; ONE-NEXT: [003]     3           {Parameter} 'Param' -> 'char'
+; ONE-NEXT: [003]     7           {TypeAlias} 'FLOAT' -> 'float'
+; ONE-NEXT: [003]     4           {TypeAlias} 'INT' -> 'int'
+; ONE-NEXT: [003]     5           {Variable} 'Value' -> 'INT'
+; ONE-NEXT: [003]     3           {Line}
+; ONE-NEXT: [003]     5           {Line}
+; ONE-NEXT: [003]     5           {Line}
+; ONE-NEXT: [003]    13           {Line}
+; ONE-NEXT: [003]    13           {Line}
+; ONE-NEXT: [003]    13           {Line}
+; ONE-NEXT: [003]    13           {Line}
+; ONE-EMPTY:
+; ONE-NEXT: Logical View:
+; ONE-NEXT: [000]           {File} 'pr-44884-dwarf-gcc.o' -> elf64-x86-64
+; ONE-EMPTY:
+; ONE-NEXT: [001]             {CompileUnit} 'pr-44884.cpp'
+; ONE-NEXT: [002]               {Producer} 'GNU C++14 10.3.0 {{.*}}'
+; ONE-NEXT: [002]     1         {Function} extern not_inlined 'bar' -> 'int'
+; ONE-NEXT: [003]     1           {Parameter} 'Input' -> 'float'
+; ONE-NEXT: [003]     1           {Line}
+; ONE-NEXT: [003]     1           {Line}
+; ONE-NEXT: [003]     1           {Line}
+; ONE-NEXT: [002]     3         {Function} extern not_inlined 'foo' -> 'unsigned int'
+; ONE-NEXT: [003]                 {Block}
+; ONE-NEXT: [004]                   {Block}
+; ONE-NEXT: [005]     9               {Variable} 'Added' -> 'FLOAT'
+; ONE-NEXT: [005]     9               {Line}
+; ONE-NEXT: [005]     9               {Line}
+; ONE-NEXT: [005]     9               {Line}
+; ONE-NEXT: [005]    10               {Line}
+; ONE-NEXT: [005]    13               {Line}
+; ONE-NEXT: [004]     7             {TypeAlias} 'FLOAT' -> 'float'
+; ONE-NEXT: [003]     3           {Parameter} 'Param' -> 'char'
+; ONE-NEXT: [003]     4           {TypeAlias} 'INT' -> 'int'
+; ONE-NEXT: [003]     5           {Variable} 'Value' -> 'INT'
+; ONE-NEXT: [003]     3           {Line}
+; ONE-NEXT: [003]     5           {Line}
+; ONE-NEXT: [003]    13           {Line}
+; ONE-NEXT: [003]    14           {Line}
+; ONE-NEXT: [003]    14           {Line}
+
+; Using the selection facilities, we can produce a simple tabular
+; output showing just the logical types that are 'Typedef'.
+
+; RUN: llvm-debuginfo-analyzer --attribute=level,format \
+; RUN:                         --output-sort=name \
+; RUN:                         --select-types=Typedef \
+; RUN:                         --report=list \
+; RUN:                         --print=types \
+; RUN:                         %p/Inputs/pr-44884-clang.wasm \
+; RUN:                         %p/../DWARF/Inputs/pr-44884-dwarf-gcc.o 2>&1 | \
+; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s
+
+; TWO:      Logical View:
+; TWO-NEXT: [000]           {File} 'pr-44884-clang.wasm' -> WASM
+; TWO-EMPTY:
+; TWO-NEXT: [001]           {CompileUnit} 'pr-44884.cpp'
+; TWO-NEXT: [003]     7     {TypeAlias} 'FLOAT' -> 'float'
+; TWO-NEXT: [003]     4     {TypeAlias} 'INT' -> 'int'
+; TWO-EMPTY:
+; TWO-NEXT: Logical View:
+; TWO-NEXT: [000]           {File} 'pr-44884-dwarf-gcc.o' -> elf64-x86-64
+; TWO-EMPTY:
+; TWO-NEXT: [001]           {CompileUnit} 'pr-44884.cpp'
+; TWO-NEXT: [004]     7     {TypeAlias} 'FLOAT' -> 'float'
+; TWO-NEXT: [003]     4     {TypeAlias} 'INT' -> 'int'
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test
new file mode 100644
index 00000000000000..cdcb7d45460331
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test
@@ -0,0 +1,127 @@
+; 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-debuginfo-analyzer --attribute=level,format,producer \
+; RUN:                         --output-sort=name \
+; RUN:                         --print=symbols,types \
+; RUN:                         %p/Inputs/pr-46466-clang.wasm \
+; 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.wasm' -> 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:                         %p/Inputs/pr-46466-clang.wasm \
+; 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.wasm' -> 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:                         %p/Inputs/pr-46466-clang.wasm \
+; 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.wasm' -> 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
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test
new file mode 100644
index 00000000000000..fac3bacffcc405
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test
@@ -0,0 +1,111 @@
+; REQUIRES: webassembly-registered-target
+
+; Test case 5 - Incorrect lexical scope variable.
+
+; pr-43860.cpp
+;  1  #include "definitions.h"
+;  2  forceinline int InlineFunction(int Param) {
+;  3    int Var_1 = Param;
+;  4    {
+;  5      int Var_2 = Param + Var_1;
+;  6      Var_1 = Var_2;
+;  7    }
+;  8    return Var_1;
+;  9  }
+; 10
+; 11  int test(int Param_1, int Param_2) {
+; 12    int A = Param_1;
+; 13    A += InlineFunction(Param_2);
+; 14    return A;
+; 15  }
+
+; The above test is used to illustrate a variable issue found in the
+; Clang compiler.
+; PR43860: https://bugs.llvm.org/show_bug.cgi?id=43860
+; PR43205: https://github.com/llvm/llvm-project/issues/43205
+
+; In the following logical views, we can see that the DWARF debug
+; information generated by the Clang compiler shows the variables
+; 'Var_1' and 'Var_2' are at the same lexical scope (4) in the function
+; 'InlineFuction'.
+; The DWARF generated by GCC/Clang show those variables at the correct
+; lexical scope: '3' and '4' respectively.
+
+; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
+; RUN:                         --output-sort=name \
+; RUN:                         --print=symbols \
+; RUN:                         %p/Inputs/pr-43860-clang.wasm \
+; RUN:                         %p/../DWARF/Inputs/pr-43860-dwarf-gcc.o 2>&1 | \
+; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
+
+; ONE:      Logical View:
+; ONE-NEXT: [000]           {File} 'pr-43860-clang.wasm' -> WASM
+; ONE-EMPTY:
+; ONE-NEXT: [001]             {CompileUnit} 'pr-43860.cpp'
+; ONE-NEXT: [002]               {Producer} 'clang version 19{{.*}}'
+; ONE-NEXT: [002]     2         {Function} extern inlined 'InlineFunction' -> 'int'
+; ONE-NEXT: [003]                 {Block}
+; ONE-NEXT: [004]     5             {Variable} 'Var_2' -> 'int'
+; ONE-NEXT: [003]     2           {Parameter} 'Param' -> 'int'
+; ONE-NEXT: [003]     3           {Variable} 'Var_1' -> 'int'
+; ONE-NEXT: [002]    11         {Function} extern not_inlined 'test' -> 'int'
+; ONE-NEXT: [003]    12           {Variable} 'A' -> 'int'
+; ONE-NEXT: [003]    13           {InlinedFunction} inlined 'InlineFunction' -> 'int'
+; ONE-NEXT: [004]                   {Block}
+; ONE-NEXT: [005]                     {Variable} 'Var_2' -> 'int'
+; ONE-NEXT: [004]                   {Parameter} 'Param' -> 'int'
+; ONE-NEXT: [004]                   {Variable} 'Var_1' -> 'int'
+; ONE-NEXT: [003]    11           {Parameter} 'Param_1' -> 'int'
+; ONE-NEXT: [003]    11           {Parameter} 'Param_2' -> 'int'
+; ONE-EMPTY:
+; ONE-NEXT: Logical View:
+; ONE-NEXT: [000]           {File} 'pr-43860-dwarf-gcc.o' -> elf64-x86-64
+; ONE-EMPTY:
+; ONE-NEXT: [001]             {CompileUnit} 'pr-43860.cpp'
+; ONE-NEXT: [002]               {Producer} 'GNU C++14 10.3.0 {{.*}}'
+; ONE-NEXT: [002]     2         {Function} extern declared_inlined 'InlineFunction' -> 'int'
+; ONE-NEXT: [003]                 {Block}
+; ONE-NEXT: [004]     5             {Variable} 'Var_2' -> 'int'
+; ONE-NEXT: [003]     2           {Parameter} 'Param' -> 'int'
+; ONE-NEXT: [003]     3           {Variable} 'Var_1' -> 'int'
+; ONE-NEXT: [002]    11         {Function} extern not_inlined 'test' -> 'int'
+; ONE-NEXT: [003]    12           {Variable} 'A' -> 'int'
+; ONE-NEXT: [003]    13           {InlinedFunction} declared_inlined 'InlineFunction' -> 'int'
+; ONE-NEXT: [004]                   {Block}
+; ONE-NEXT: [005]                     {Variable} 'Var_2' -> 'int'
+; ONE-NEXT: [004]                   {Parameter} 'Param' -> 'int'
+; ONE-NEXT: [004]                   {Variable} 'Var_1' -> 'int'
+; ONE-NEXT: [003]    11           {Parameter} 'Param_1' -> 'int'
+; ONE-NEXT: [003]    11           {Parameter} 'Param_2' -> 'int'
+
+; Using the selection facilities, we can produce a simple tabular output
+; showing just the logical elements that have in their name the 'var'
+; pattern. The logical view is sorted by the variables name.
+
+; RUN: llvm-debuginfo-analyzer --attribute=level,format \
+; RUN:                         --output-sort=name \
+; RUN:                         --select-regex --select-nocase \
+; RUN:                         --select=Var \
+; RUN:                         --report=list \
+; RUN:                         --print=symbols \
+; RUN:                         %p/Inputs/pr-43860-clang.wasm \
+; RUN:                         %p/../DWARF/Inputs/pr-43860-dwarf-gcc.o 2>&1 | \
+; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s
+
+; TWO:      Logical View:
+; TWO-NEXT: [000]           {File} 'pr-43860-clang.wasm' -> WASM
+; TWO-EMPTY:
+; TWO-NEXT: [001]           {CompileUnit} 'pr-43860.cpp'
+; TWO-NEXT: [004]           {Variable} 'Var_1' -> 'int'
+; TWO-NEXT: [003]     3     {Variable} 'Var_1' -> 'int'
+; TWO-NEXT: [005]           {Variable} 'Var_2' -> 'int'
+; TWO-NEXT: [004]     5     {Variable} 'Var_2' -> 'int'
+; TWO-EMPTY:
+; TWO-NEXT: Logical View:
+; TWO-NEXT: [000]           {File} 'pr-43860-dwarf-gcc.o' -> elf64-x86-64
+; TWO-EMPTY:
+; TWO-NEXT: [001]           {CompileUnit} 'pr-43860.cpp'
+; TWO-NEXT: [004]           {Variable} 'Var_1' -> 'int'
+; TWO-NEXT: [003]     3     {Variable} 'Var_1' -> 'int'
+; TWO-NEXT: [005]           {Variable} 'Var_2' -> 'int'
+; TWO-NEXT: [004]     5     {Variable} 'Var_2' -> 'int'
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
new file mode 100644
index 00000000000000..9f4c95eea093f6
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
@@ -0,0 +1,155 @@
+; REQUIRES: webassembly-registered-target
+
+; Test case 6 - Full logical view
+
+; test.cpp
+;  1  using INTPTR = const int *;
+;  2  int foo(INTPTR ParamPtr, unsigned ParamUnsigned, bool ParamBool) {
+;  3    if (ParamBool) {
+;  4      typedef int INTEGER;
+;  5      const INTEGER CONSTANT = 7;
+;  6      return CONSTANT;
+;  7    }
+;  8    return ParamUnsigned;
+;  9  }
+
+; Print low level details.
+; The following command prints low level information that includes
+; offsets within the debug information section, debug location
+; operands, linkage names, etc.
+
+; RUN: llvm-debuginfo-analyzer --attribute=all \
+; RUN:                         --print=all \
+; RUN:                         %p/Inputs/test-clang.wasm 2>&1 | \
+; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
+
+; ONE:      Logical View:
+; ONE-NEXT: [0x0000000000][000]            {File} '{{.*}}test-clang.wasm' -> WASM
+; ONE-EMPTY:
+; ONE-NEXT: [0x000000000b][001]              {CompileUnit} 'test.cpp'
+; ONE-NEXT: [0x000000000b][002]                {Producer} 'clang version 19{{.*}}'
+; ONE-NEXT:                                    {Directory} '{{.*}}/general'
+; ONE-NEXT:                                    {File} 'test.cpp'
+; ONE-NEXT:                                    {Public} 'foo' [0x0000000002:0x0000000081]
+; ONE-NEXT: [0x000000000b][002]                {Range} Lines 2:9 [0x0000000002:0x0000000081]
+; ONE-NEXT: [0x00000000bf][002]                {BaseType} 'bool'
+; ONE-NEXT: [0x000000009c][002]                {BaseType} 'int'
+; ONE-NEXT: [0x00000000b8][002]                {BaseType} 'unsigned int'
+; ONE-EMPTY:
+; ONE-NEXT: [0x00000000a3][002]   {Source} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x00000000a3][002]      1         {TypeAlias} 'INTPTR' -> [0x00000000ae]'* const int'
+; ONE-NEXT: [0x000000002a][002]      2         {Function} extern not_inlined 'foo' -> [0x000000009c]'int'
+; ONE-NEXT: [0x000000002a][003]                  {Range} Lines 2:9 [0x0000000002:0x0000000081]
+; ONE-NEXT: [0x000000002a][003]                  {Linkage}  0x3 '_Z3fooPKijb'
+; ONE-NEXT: [0x0000000074][003]                  {Block}
+; ONE-NEXT: [0x0000000074][004]                    {Range} Lines 5:0 [0x000000004e:0x0000000066]
+; ONE-NEXT: [0x0000000081][004]      5             {Variable} 'CONSTANT' -> [0x00000000c6]'const INTEGER'
+; ONE-NEXT: [0x0000000081][005]                      {Coverage} 100.00%
+; ONE-NEXT: [0x0000000082][005]                      {Location}
+; ONE-NEXT: [0x0000000082][006]                        {Entry} fbreg 4
+; ONE-NEXT: [0x000000004e][004]      5             {Line} {NewStatement} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x000000004e][004]                    {Code} 'i32.const	7'
+; ONE-NEXT: [0x0000000050][004]                    {Code} 'local.set	10'
+; ONE-NEXT: [0x0000000052][004]                    {Code} 'local.get	5'
+; ONE-NEXT: [0x0000000054][004]                    {Code} 'local.get	10'
+; ONE-NEXT: [0x0000000056][004]                    {Code} 'i32.store	4'
+; ONE-NEXT: [0x0000000059][004]      6             {Line} {NewStatement} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000059][004]                    {Code} 'i32.const	7'
+; ONE-NEXT: [0x000000005b][004]                    {Code} 'local.set	11'
+; ONE-NEXT: [0x000000005d][004]                    {Code} 'local.get	5'
+; ONE-NEXT: [0x000000005f][004]                    {Code} 'local.get	11'
+; ONE-NEXT: [0x0000000061][004]                    {Code} 'i32.store	28'
+; ONE-NEXT: [0x0000000064][004]                    {Code} 'br      	1'
+; ONE-NEXT: [0x0000000066][004]      0             {Line} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000066][004]                    {Code} 'end'
+; ONE-NEXT: [0x0000000066][003]      2           {Parameter} 'ParamBool' -> [0x00000000bf]'bool'
+; ONE-NEXT: [0x0000000066][004]                    {Coverage} 100.00%
+; ONE-NEXT: [0x0000000067][004]                    {Location}
+; ONE-NEXT: [0x0000000067][005]                      {Entry} fbreg 11
+; ONE-NEXT: [0x000000004a][003]      2           {Parameter} 'ParamPtr' -> [0x00000000a3]'INTPTR'
+; ONE-NEXT: [0x000000004a][004]                    {Coverage} 100.00%
+; ONE-NEXT: [0x000000004b][004]                    {Location}
+; ONE-NEXT: [0x000000004b][005]                      {Entry} fbreg 16
+; ONE-NEXT: [0x0000000058][003]      2           {Parameter} 'ParamUnsigned' -> [0x00000000b8]'unsigned int'
+; ONE-NEXT: [0x0000000058][004]                    {Coverage} 100.00%
+; ONE-NEXT: [0x0000000059][004]                    {Location}
+; ONE-NEXT: [0x0000000059][005]                      {Entry} fbreg 12
+; ONE-NEXT: [0x0000000090][003]      4           {TypeAlias} 'INTEGER' -> [0x000000009c]'int'
+; ONE-NEXT: [0x0000000002][003]      2           {Line} {NewStatement} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000002][003]                  {Code} 'block   	unknown_type'
+; ONE-NEXT: [0x0000000004][003]                  {Code} 'i64.mul'
+; ONE-NEXT: [0x0000000005][003]                  {Code} 'throw   	127'
+; ONE-NEXT: [0x0000000007][003]                  {Code} 'global.get	0'
+; ONE-NEXT: [0x000000000d][003]                  {Code} 'local.set	3'
+; ONE-NEXT: [0x000000000f][003]                  {Code} 'i64.const	32'
+; ONE-NEXT: [0x0000000011][003]                  {Code} 'local.set	4'
+; ONE-NEXT: [0x0000000013][003]                  {Code} 'local.get	3'
+; ONE-NEXT: [0x0000000015][003]                  {Code} 'local.get	4'
+; ONE-NEXT: [0x0000000017][003]                  {Code} 'i64.sub'
+; ONE-NEXT: [0x0000000018][003]                  {Code} 'local.set	5'
+; ONE-NEXT: [0x000000001a][003]                  {Code} 'local.get	5'
+; ONE-NEXT: [0x000000001c][003]                  {Code} 'local.get	0'
+; ONE-NEXT: [0x000000001e][003]                  {Code} 'i64.store	16'
+; ONE-NEXT: [0x0000000021][003]                  {Code} 'local.get	5'
+; ONE-NEXT: [0x0000000023][003]                  {Code} 'local.get	1'
+; ONE-NEXT: [0x0000000025][003]                  {Code} 'i32.store	12'
+; ONE-NEXT: [0x0000000028][003]                  {Code} 'local.get	2'
+; ONE-NEXT: [0x000000002a][003]                  {Code} 'local.set	6'
+; ONE-NEXT: [0x000000002c][003]                  {Code} 'local.get	5'
+; ONE-NEXT: [0x000000002e][003]                  {Code} 'local.get	6'
+; ONE-NEXT: [0x0000000030][003]                  {Code} 'i32.store8	11'
+; ONE-NEXT: [0x0000000033][003]      3           {Line} {NewStatement} {PrologueEnd} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000033][003]                  {Code} 'local.get	5'
+; ONE-NEXT: [0x0000000035][003]                  {Code} 'i32.load8_u	11'
+; ONE-NEXT: [0x0000000038][003]                  {Code} 'local.set	7'
+; ONE-NEXT: [0x000000003a][003]      3           {Line} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x000000003a][003]                  {Code} 'i32.const	1'
+; ONE-NEXT: [0x000000003c][003]                  {Code} 'local.set	8'
+; ONE-NEXT: [0x000000003e][003]                  {Code} 'local.get	7'
+; ONE-NEXT: [0x0000000040][003]                  {Code} 'local.get	8'
+; ONE-NEXT: [0x0000000042][003]                  {Code} 'i32.and'
+; ONE-NEXT: [0x0000000043][003]                  {Code} 'local.set	9'
+; ONE-NEXT: [0x0000000045][003]                  {Code} 'block'
+; ONE-NEXT: [0x0000000047][003]                  {Code} 'block'
+; ONE-NEXT: [0x0000000049][003]                  {Code} 'local.get	9'
+; ONE-NEXT: [0x000000004b][003]                  {Code} 'i32.eqz'
+; ONE-NEXT: [0x000000004c][003]                  {Code} 'br_if   	0'
+; ONE-NEXT: [0x0000000067][003]      8           {Line} {NewStatement} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000067][003]                  {Code} 'local.get	5'
+; ONE-NEXT: [0x0000000069][003]                  {Code} 'i32.load	12'
+; ONE-NEXT: [0x000000006c][003]                  {Code} 'local.set	12'
+; ONE-NEXT: [0x000000006e][003]      8           {Line} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x000000006e][003]                  {Code} 'local.get	5'
+; ONE-NEXT: [0x0000000070][003]                  {Code} 'local.get	12'
+; ONE-NEXT: [0x0000000072][003]                  {Code} 'i32.store	28'
+; ONE-NEXT: [0x0000000075][003]      0           {Line} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000075][003]                  {Code} 'end'
+; ONE-NEXT: [0x0000000076][003]      9           {Line} {NewStatement} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000076][003]                  {Code} 'local.get	5'
+; ONE-NEXT: [0x0000000078][003]                  {Code} 'i32.load	28'
+; ONE-NEXT: [0x000000007b][003]                  {Code} 'local.set	13'
+; ONE-NEXT: [0x000000007d][003]                  {Code} 'local.get	13'
+; ONE-NEXT: [0x000000007f][003]                  {Code} 'return'
+; ONE-NEXT: [0x0000000080][003]                  {Code} 'end'
+; ONE-NEXT: [0x0000000081][003]      9           {Line} {NewStatement} {EndSequence} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000081][003]                  {Code} 'unreachable'
+; ONE-EMPTY:
+; ONE-NEXT: -----------------------------
+; ONE-NEXT: Element      Total    Printed
+; ONE-NEXT: -----------------------------
+; ONE-NEXT: Scopes           3          3
+; ONE-NEXT: Symbols          4          4
+; ONE-NEXT: Types            5          5
+; ONE-NEXT: Lines           73         73
+; ONE-NEXT: -----------------------------
+; ONE-NEXT: Total           85         85
+; ONE-EMPTY:
+; ONE-NEXT: Scope Sizes:
+; ONE-NEXT:        192 (100.00%) : [0x000000000b][001]              {CompileUnit} 'test.cpp'
+; ONE-NEXT:        113 ( 58.85%) : [0x000000002a][002]      2         {Function} extern not_inlined 'foo' -> [0x000000009c]'int'
+; ONE-NEXT:         27 ( 14.06%) : [0x0000000074][003]                  {Block}
+; ONE-EMPTY:
+; ONE-NEXT: Totals by lexical level:
+; ONE-NEXT: [001]:        192 (100.00%)
+; ONE-NEXT: [002]:        113 ( 58.85%)
+; ONE-NEXT: [003]:         27 ( 14.06%)
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/definitions.h b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/definitions.h
new file mode 100644
index 00000000000000..dfbd3db044dd80
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/definitions.h
@@ -0,0 +1,30 @@
+//-----------------------------------------------------------------------------
+// Definitions.
+//-----------------------------------------------------------------------------
+#ifndef SUITE_DEFINITIONS_H
+#define SUITE_DEFINITIONS_H
+
+#ifdef _MSC_VER
+#define forceinline __forceinline
+#define OPTIMIZE_OFF __pragma(optimize("", off))
+#define OPTIMIZE_ON  __pragma(optimize("", on))
+#elif defined(__clang__)
+#if __has_attribute(__always_inline__)
+#define forceinline inline __attribute__((__always_inline__))
+#else
+#define forceinline inline
+#endif
+#define OPTIMIZE_OFF _Pragma("clang optimize off")
+#define OPTIMIZE_ON  _Pragma("clang optimize on")
+#elif defined(__GNUC__)
+#define forceinline inline __attribute__((__always_inline__))
+#define OPTIMIZE_OFF _Pragma("GCC optimize off")
+#define OPTIMIZE_ON  _Pragma("GCC optimize on")
+#else
+#define forceinline inline
+#define OPTIMIZE_OFF
+#define OPTIMIZE_ON
+#error
+#endif
+
+#endif // SUITE_DEFINITIONS_H
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wasm
new file mode 100644
index 0000000000000000000000000000000000000000..a4f21dd31de18f5c4236dedfe31961fda23d773a
GIT binary patch
literal 1414
zcmc&!&5zqe6n`_eV>`||*+wk=kdULcd}xWYyJVByRx0e41tMCp>Q+K62Y2F398<@(
z#&*h9upi>aZ4n1<@CU$^KY>c9XU at Isu?HkhaN&(Nl`8cQz>?p4^PBfI at 4Xpd*^~eP
zIXOBy0_6da!w2->K+;2`^i;yC!sA)p^P({3On6g1O~gJ`$sEpd=0Eh(B#d(|l!Fpp
z at b33gfyj9GQ~xoP*agoE<54KMpL^pX_VX}_y_^jrPEr8nTN#Q1tsP5&RR1a06Ae8c
z((=EI$Pu()yU`*JIOLlab?B86+=7<kP)F&}+O`DB4_fLrv@}O`w1x!WBC1u;T1Qp=
z>z3gdXVy-oZq*4nY?Ps;*Scl>AT0=NgJplhqbPaT`8*NPs0#3x+*xo(d{_h?8x94Z
zkwtRVZfc6%c>R*SNX}INXcq>}Yu0s(p2yP>GH3#*EyVg3fc7Q|0F^7C*f%T-5nYOw
zbpu7i1?l30^NKC)2hH~{V2j{8%nq!1*f1U^j}cVm4j8hBSeawV at H@eumJ+~3%GZ$)
z%~a+XC?BJw?jf;3yM?UsL=vJuMP}&6%f{++pg%oBoG3G?bc#g7xPQxhs`GrZT=)@-
z182rXhK+SrH{BI?B?xop?Ma at e*|kmw7n5S>W+8X8B;I%ZWZKyq?6h}9IAb~Q_-WD3
zlO*ydER5S}DqLy4xxrS}x?R>?ANTm?#;7;)*VcU2 at At=D)*r63^$os($U88RZE8P~
zU2^?2h0ciOtdol5OB}hZlldY{kqaIOp2;NJSrKB~FiwlS6Y!V|76C>V;CWkj?rh!j
z_6GNNyu0^ycRUZKm=)ki1N<om;6*3ot at sE_qQYCUMuhxpFGyBiD+FFi3$*}D`l7_I
zX-bu at HjQ8DB{YNQ(zlLIABJ&2jo;<c1eM_ZOGFriF^fEz32gwO75A2lm6u&?U<Onz
zb5x1tl{(%m2}cU8DAZ7>seLbf5!)4sEQ~w1CGfMvtAa;~@810E!yUDv+eE)i>Rrrn
zpy-T10`P~_T0GNwX$bY2S*d_o)4 at Ea9}{!Q0P~`LLYCeDXuL<kysbYW=3V_MS^5Hx
z9qG at A`A9z{@Z+ogWGPLu)W!PzB8SVw-i-<$CyE+!xC$0<V&C-AsL0O9Y8Ps#<YPbi
zs6E^#S~-Q{f0(}C<az2j69LEfjkCPKDN~l~)1rLi+Ch{IS(GgsSs27^{#CwgoV}#I
F?tgDnWN`oh

literal 0
HcmV?d00001

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wat
new file mode 100644
index 00000000000000..a79cd8749a5fb6
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wat
@@ -0,0 +1,52 @@
+(module
+  (type (;0;) (func (result i32)))
+  (type (;1;) (func (param i64 i64) (result i32)))
+  (type (;2;) (func (param i32 i64) (result i32)))
+  (import "env" "__linear_memory" (memory (;0;) i64 1))
+  (import "env" "__stack_pointer" (global (;0;) (mut i64)))
+  (import "env" "_Z6printfPKcz" (func (;0;) (type 1)))
+  (import "env" "__indirect_function_table" (table (;0;) 0 funcref))
+  (func $__original_main (type 0) (result i32)
+    (local i64 i64 i64 i32 i64 i64 i32 i64 i64)
+    global.get 0
+    local.set 0
+    i64.const 16
+    local.set 1
+    local.get 0
+    local.get 1
+    i64.sub
+    local.set 2
+    local.get 2
+    global.set 0
+    i32.const 0
+    local.set 3
+    local.get 2
+    local.get 3
+    i32.store offset=12
+    i64.const 0
+    local.set 4
+    i64.const 0
+    local.set 5
+    local.get 4
+    local.get 5
+    call 0
+    drop
+    i32.const 0
+    local.set 6
+    i64.const 16
+    local.set 7
+    local.get 2
+    local.get 7
+    i64.add
+    local.set 8
+    local.get 8
+    global.set 0
+    local.get 6
+    return)
+  (func $main (type 2) (param i32 i64) (result i32)
+    (local i32)
+    call $__original_main
+    local.set 2
+    local.get 2
+    return)
+  (data $.L.str (i64.const 0) "Hello, World\0a\00"))
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world.cpp b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world.cpp
new file mode 100644
index 00000000000000..73a8e247e26ec3
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world.cpp
@@ -0,0 +1,7 @@
+extern int printf(const char * format, ... );
+
+int main()
+{
+  printf("Hello, World\n");
+  return 0;
+}
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wasm
new file mode 100644
index 0000000000000000000000000000000000000000..da9355b3ad7dc71ce16f601bcc29b4f4ee7cba5b
GIT binary patch
literal 1613
zcmc&#TZ<e;6h2keJ=2%D?2XApSLwzm(Pese*527mz^HKpOCF2{ygfMf^wiGwW~RI8
zt{z>)?5-~%Ai)Je5kUg_5D at YrK8xfB<Uu6=AVTmVPYFoCQ at xvY7Jq;Zb*jGae0{1;
z)v0dq(jfr=a&>oi7sy9+XNT<2TM|&l!%?-<83ZBslFpD1qhy;Za7d at Z^DlSeC<p~l
z*cHM)&m(~G!=8+EgHU$G+<6YkU9jovmdz|`vCnM9QY>iG3G7IlmMrBoov>9zYMW{j
zmFxndLYvM?G;0?T72C9afO1LQ)-BD_w`>D_Mw`w^-;8Y{G7pt?I}fedWvgtJw(JV}
zDu**@cGap at P54!=wCwbFH|ux2Za3j0GD)7VOslLiapLL9B$+AzP=|ySR#`RAnCsJL
zPg*7bQ{f2#ptxf|HE}l!r;vHYG*MY}Fyd6<)%th{08Is2|2Ks09)rd+q%|#Hd(V8|
zd>5mbQr?;dC`q9ll+8RYo*X=qS(t}e1mQ;XCz6WvfF_R?Y}k_>KG(6ad<1X<dwLtq
zU2KGYC at s5xG*%wugrrsFp&YAnjLF?YqbkMmILcq3eE%5vB2Gw5Db(oxL}?tAW{!|f
z_qADxN>XXOgk}w!e9mGcWzD4fv#U5P(fzt~l`o- at kJKVL^Hz?~+{Cg2<1qVFB>un)
z`__mjX%K~0YsHy&=KF!LPHzekr>o5-g3YY!qycx*DBO1ZXxO~8zSg*y1S3!IrXObw
z5k&)k(+k2z94C%^eP!93UvOQ|UEFB%mE~T$=PxYy-qO<2hU+bL7rn)0zKqO^5GM`y
z<>mIg<Hs>Hd!F!`aT0BDU!={{Pl6cxg!dDk$`v-!EWk;FFwR7?&qJPg1L%Cva at Rw7
z at 6KnTFHjc1aSV9t;G&m!LwE=8W-GS~_ at XO#DuMuHcOXD#F6=D8YXH~Ai$%_`jeDrT
zDYS%;zbj?g;n9FRp5wV7382#_=gthGng)GgS}hiYdZLi2RW|w~2a|=7dQy@?)rDF{
zmx;(gR^3(&?Sje*0zV`;&rSJtDB?OU2VtLT-%6<Bdi0}A=mapTFj`==2wzISk?=v}
zJLlefV~vrbPT-MbClA=MYoN~P1qynJfj-6dh+f06PqFKy_AI6`$8Hn7$?g*U47*SC
z^Xvi9-)0Yq-eLDhZ37h_v&TgLlwGCzHNw82`qzYgMfD#E`;OLrCh!~7ekX7T;G6%>
zF88%aYAxKapX7e)SOC4u$C{*?EYHmAb5c3ii3eGFU|KGeP~>A#@Lr?4P1L-OlmDT9
xf06lAg_rcX=xlILWLT<ft~$(w*B$Uie-L%OK{}_UK|gHpPsE&d at M~zh{{VKhUE2Tv

literal 0
HcmV?d00001

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wat
new file mode 100644
index 00000000000000..4461a5844667c9
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wat
@@ -0,0 +1,75 @@
+(module
+  (type (;0;) (func (param i32 i32) (result i32)))
+  (import "env" "__linear_memory" (memory (;0;) i64 0))
+  (import "env" "__stack_pointer" (global (;0;) (mut i64)))
+  (func $_Z4testii (type 0) (param i32 i32) (result i32)
+    (local i64 i64 i64 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
+    global.get 0
+    local.set 2
+    i64.const 32
+    local.set 3
+    local.get 2
+    local.get 3
+    i64.sub
+    local.set 4
+    local.get 4
+    local.get 0
+    i32.store offset=16
+    local.get 4
+    local.get 1
+    i32.store offset=12
+    local.get 4
+    i32.load offset=16
+    local.set 5
+    local.get 4
+    local.get 5
+    i32.store offset=8
+    local.get 4
+    i32.load offset=12
+    local.set 6
+    local.get 4
+    local.get 6
+    i32.store offset=28
+    local.get 4
+    i32.load offset=28
+    local.set 7
+    local.get 4
+    local.get 7
+    i32.store offset=24
+    local.get 4
+    i32.load offset=28
+    local.set 8
+    local.get 4
+    i32.load offset=24
+    local.set 9
+    local.get 8
+    local.get 9
+    i32.add
+    local.set 10
+    local.get 4
+    local.get 10
+    i32.store offset=20
+    local.get 4
+    i32.load offset=20
+    local.set 11
+    local.get 4
+    local.get 11
+    i32.store offset=24
+    local.get 4
+    i32.load offset=24
+    local.set 12
+    local.get 4
+    i32.load offset=8
+    local.set 13
+    local.get 13
+    local.get 12
+    i32.add
+    local.set 14
+    local.get 4
+    local.get 14
+    i32.store offset=8
+    local.get 4
+    i32.load offset=8
+    local.set 15
+    local.get 15
+    return))
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860.cpp b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860.cpp
new file mode 100644
index 00000000000000..a3d3b76c59e586
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860.cpp
@@ -0,0 +1,15 @@
+#include "definitions.h"
+forceinline int InlineFunction(int Param) {
+  int Var_1 = Param;
+  {
+    int Var_2 = Param + Var_1;
+    Var_1 = Var_2;
+  }
+  return Var_1;
+}
+
+int test(int Param_1, int Param_2) {
+  int A = Param_1;
+  A += InlineFunction(Param_2);
+  return A;
+}
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wasm
new file mode 100644
index 0000000000000000000000000000000000000000..ef8d5f69ee9980623dbb98192c58f5fd9676da44
GIT binary patch
literal 1882
zcmc%~ONbmr^i@??cURAMcQ&)5L8!)6VwRan*2(T9f at WQ#tcr=4hzK(2>FJ$xGSf5k
zXU&59Nz5sMg#?d&Ku~f}1VPb&UXnvDVh$l*qQs+z95e?F9^$K+-H?UcE$H|E)vNbr
zz=^s90LZzuwKbqe$ue0zN><4#{c0d!Ua**JG&+9ZIboygb$j6w)nG#$#g2QT(eL>|
z?1gNFu=fW}K&;EBRXCrq6}GIeK91rwu*vgzn at S?-vdtuuP^W3hcG9%1N$s4?=dg~0
zwl2BU-?0s89I#EgpYE4t2Bdb;7E;(&nxtk`u#<L5rfe%EEjumKxzr89*^0GFmyK1r
z^3Ze>gBn!YeUOu^3^`kyE!kXZlE;`8^Cp;;Nn at ItlI@_TjYydZG_$0TR;-drE5Vee
zOdq#1GV`^aMVD-yYU(DMos+rzAd#I%dH#N=kzuG&3{{Y$vJl&2a!eKydz&1Q+m72s
zY|S`&jK61>WND+;VlD;$U^K{7T3$10H=JfO^cKkoc_LfjESn$So*f}a#sTOAu<Wy`
zR0 at DqP(P~gF9lha-IsbMHD7q{5de(?Eo}+_cx?--rv^>{MiJ%<Lo<90`12HIPi<uP
zgN5GjDAbe&Of@!O!zqREtPjzBNUtEtHAXiiK4R at QuurZcaScC0b}A7)pT0fdZXg8K
zRS=Kj2Ikk1xQQQOKPwSEpSwHYenrUXc~iqW2>%W_{SpFoUcnDlT2`sVWhF9HE=%#6
zp+b)-(g1o(=`?x=k*3jmh;-Ea_+ZmRCun=o<~2^Bi8`Bg&Y}53&u3}_tc})1ap-n1
zj$HJ@$nOPm_uk5`%C5E_%N at t!xF7ASR*^ZDG%JzsRia+7RB?OV>KpS1%7;RK(TTmP
z+fT}Iuh(&pIet*?_rr>E-&=QfP1R~nZO_8Ax3}J!Zn;xat}`<;vruzpntPl*b+3++
zr=TB}Yqfg4R&o1%sJ5KgsrJL(anFsTYUGA~A93ilLoZSlmZQYSq<+v(;%eIqywK?Y
z?m0Bxe!A&|3xGh;3%#BT2p|a}za4ljsf^~88!U8sP7H^f(CGqJ9m1PVC-GqZwZkym
zYI!Yq at zsN~hXFo)aLUwA%?0eJ1``MgA^&DG3aLJ;N85UjLF)zGd>z6kEb}j&PL0^#
z+r0EL{#2o(pqsBX#&Z at ek8wjcPxEd1N&c7~^X-a`dFCx%&=a0RN#<j2>F at GUB=e|b
zF&$TNzENXgV1Xz6piRxs2P_t9Z1jZYv23C^)fGl at _;p4NMosuc*;=93>A97;gD)Il
z+^~qTM2vNe`!@mO5+!g}^<iXa^uW&XaiKF1X%1qPpCY2DgLss$6Y-=5Vv=7W#VG(W
z$FCCc62C^o5q_H#9SS1k*NIr<H;Fhy_+26{5PpUhKO*!e5ML6$PQ?#|pQYj|;U7?O
zjqqDU{6hF0B7P(M9)XLh=)#tIhRdL9MQnW0gg>B|r%)`>8w5U7)?2GrZ)wuvZnS+J
zpXdv9KY>HnN?hCnYO0k;oVG`@bB%r{iH2Zz4bo`j;vjmha&w9B!S00r!_IuG?v#t2
ru<gZ-1<#2STn{#x>n5?&?0DsNr`L2k(WI$nzwDiiC(Yr1<aF&nJ2{z%

literal 0
HcmV?d00001

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wat
new file mode 100644
index 00000000000000..6b65ca23ab6d64
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wat
@@ -0,0 +1,149 @@
+(module
+  (type (;0;) (func (param f32) (result i32)))
+  (type (;1;) (func (param i32) (result i32)))
+  (import "env" "__linear_memory" (memory (;0;) i64 0))
+  (import "env" "__stack_pointer" (global (;0;) (mut i64)))
+  (func $_Z3barf (type 0) (param f32) (result i32)
+    (local i64 i64 i64 f32 f32 f32 i32 i32 i32 i32 i32 i32)
+    global.get 0
+    local.set 1
+    i64.const 16
+    local.set 2
+    local.get 1
+    local.get 2
+    i64.sub
+    local.set 3
+    local.get 3
+    local.get 0
+    f32.store offset=12
+    local.get 3
+    f32.load offset=12
+    local.set 4
+    local.get 4
+    f32.abs
+    local.set 5
+    f32.const 0x1p+31 (;=2.14748e+09;)
+    local.set 6
+    local.get 5
+    local.get 6
+    f32.lt
+    local.set 7
+    local.get 7
+    i32.eqz
+    local.set 8
+    block  ;; label = @1
+      block  ;; label = @2
+        local.get 8
+        br_if 0 (;@2;)
+        local.get 4
+        i32.trunc_f32_s
+        local.set 9
+        local.get 9
+        local.set 10
+        br 1 (;@1;)
+      end
+      i32.const -2147483648
+      local.set 11
+      local.get 11
+      local.set 10
+    end
+    local.get 10
+    local.set 12
+    local.get 12
+    return)
+  (func $_Z3fooc (type 1) (param i32) (result i32)
+    (local i64 i64 i64 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 f32 f32 i32 i32 i32 i32 i32 i32 i32 i64 i64)
+    global.get 0
+    local.set 1
+    i64.const 16
+    local.set 2
+    local.get 1
+    local.get 2
+    i64.sub
+    local.set 3
+    local.get 3
+    global.set 0
+    local.get 3
+    local.get 0
+    i32.store8 offset=15
+    local.get 3
+    i32.load8_u offset=15
+    local.set 4
+    i32.const 24
+    local.set 5
+    local.get 4
+    local.get 5
+    i32.shl
+    local.set 6
+    local.get 6
+    local.get 5
+    i32.shr_s
+    local.set 7
+    local.get 3
+    local.get 7
+    i32.store offset=8
+    local.get 3
+    i32.load offset=8
+    local.set 8
+    local.get 3
+    i32.load8_u offset=15
+    local.set 9
+    i32.const 24
+    local.set 10
+    local.get 9
+    local.get 10
+    i32.shl
+    local.set 11
+    local.get 11
+    local.get 10
+    i32.shr_s
+    local.set 12
+    local.get 8
+    local.get 12
+    i32.add
+    local.set 13
+    local.get 13
+    f32.convert_i32_s
+    local.set 14
+    local.get 3
+    local.get 14
+    f32.store offset=4
+    local.get 3
+    f32.load offset=4
+    local.set 15
+    local.get 15
+    call $_Z3barf
+    local.set 16
+    local.get 3
+    local.get 16
+    i32.store offset=8
+    local.get 3
+    i32.load offset=8
+    local.set 17
+    local.get 3
+    i32.load8_u offset=15
+    local.set 18
+    i32.const 24
+    local.set 19
+    local.get 18
+    local.get 19
+    i32.shl
+    local.set 20
+    local.get 20
+    local.get 19
+    i32.shr_s
+    local.set 21
+    local.get 17
+    local.get 21
+    i32.add
+    local.set 22
+    i64.const 16
+    local.set 23
+    local.get 3
+    local.get 23
+    i64.add
+    local.set 24
+    local.get 24
+    global.set 0
+    local.get 22
+    return))
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884.cpp b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884.cpp
new file mode 100644
index 00000000000000..4b47aae8e0b17b
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884.cpp
@@ -0,0 +1,14 @@
+int bar(float Input) { return (int)Input; }
+
+unsigned foo(char Param) {
+  typedef int INT;
+  INT Value = Param;
+  {
+    typedef float FLOAT;
+    {
+      FLOAT Added = Value + Param;
+      Value = bar(Added);
+    }
+  }
+  return Value + Param;
+}
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wasm
new file mode 100644
index 0000000000000000000000000000000000000000..f20d68bca653baa359bb0067c05d790a338961f7
GIT binary patch
literal 1180
zcmc&!Pix#p6n{@6?P at GrwqtP87J>sQq?pw at M&4bg&?F5x_*QV!LodomJC at aGB{4JF
z)|bRKgg_v<6>>{IK%uu at dkG<@kV}ruCFfpx?WJ$l4!HCKL@@9Fd-L?(PXeJQ2mtu-
z at bD1uF5m;_H!C_!R at 22KDT_)9l}zNMRtJuYr)F(Lb}wn_qB2sk`^b)G`7nPp<8x1D
zEI at p46EDFUEC#`&lZdY&pbL*F4i=)ZOxrvWX{zKDm+|v(#be>p`Om^-Jl6qmVqoFU
z%JomK1z!fv1pu~!gMfuWU=0B7!pv`#5vksJIP2|1V9VUNP=zeCF}4yw_cA4Y6$F$3
z at U!hBIPIgT_UeaZbgc(`I~TYFN0!m^l#Vl#0Bo-Fg2;6`=yP^z2j;!D7DV?Y at o%l{
zf#<!N86D`HEztdImiGKDIp5g;Zm;UTC*n~Hf7{mPPFvGPWu>U{wW(CPsH?TB+tEg}
zkr!s|%Dyp;zSi%PvfrkWE at Y(Z>LAMMNq=|ecJCWiOofsCtZ93uuFGs+6jiTjRAke)
zM`B|$jzzq+H;~(- at nD>7Zf0UQ9PY(pm~M%!ksOib3usg?9>jw|lr;_X$HItyqv{`I
zW^`X?s%VHSnJcMnhdtdEbZJpFt?B2ol1h}Y3wPj7MPAr7s?7`}-^WI3GX+b5&;;<t
z;^f0hEc|ZJKwP*?l;-+RxL}#x4ITV%Q)C2>%>j2jE7HR_IzA=9AGT_j%H1of-0^?0
zYKO}DA38u6cc~zAI?fU>$7c at r9@{AFM5)#hIpI&MFDqHrS#$<7-6c+o<?}A^bM6uH
zRS)>5?o(X72*B6f7q~P;;5XgZ$ambA$iH)6;c5b~P%*CEx5$5V-yuIn_dUY1|6gHe
zz;Ttn1^Crsg45K;ZAL(Fe2a-z<PyVMNmI7^gj|hbo`N#kgdF$M1N3I#Q6B*`zuWg&
rG(zRlBzsbrmhi#W7bmR|X(@YoS*N1Z>%K1XswaOk>;B2VW)S}iE1n&T

literal 0
HcmV?d00001

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wat
new file mode 100644
index 00000000000000..4c1f2857c636e7
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wat
@@ -0,0 +1,11 @@
+(module
+  (type (;0;) (func (result i32)))
+  (import "env" "__linear_memory" (memory (;0;) i64 1))
+  (import "env" "__stack_pointer" (global (;0;) (mut i64)))
+  (func $_Z4testv (type 0) (result i32)
+    (local i32)
+    i32.const 1
+    local.set 0
+    local.get 0
+    return)
+  (data $S (i64.const 0) "\00"))
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466.cpp b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466.cpp
new file mode 100644
index 00000000000000..28be9a5d60ec3b
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466.cpp
@@ -0,0 +1,11 @@
+struct Struct {
+  union Union {
+    enum NestedEnum { RED, BLUE };
+  };
+  Union U;
+};
+
+Struct S;
+int test() {
+  return S.U.BLUE;
+}
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wasm
new file mode 100644
index 0000000000000000000000000000000000000000..2147ec7fa041097909833b74370f7db4581724e1
GIT binary patch
literal 1459
zcmc&!&2Jk;6n`_bA0Dscd{}Y=RA^Te6cpJ`g5!LEO41Oa2q}%)a6y&Kcs+48wRg?#
zY}6nTCrBXZ0ksDNhawJK5MMnYA$lSw)I$$F^uVRJ9^q1P<51q%X$j&FV5NEQ{eFHs
z at 6DUv8bs0|06;!EI5+_EHrwy at NRQssh%y=O4%h4LAe17mcVs7u_oxBKbfScRx!#R}
zP|29>6ZU?83&<WG>aBW|?Pq$=A$I^CJLh_a%Ut6<&vZ=}=GX{2QlmMSdKQM(A~>#D
z0>`tLiI;J0H}j6i=@MOX`RWiX+g=v4vNdX8h?%Zaqo;EOqY0Yxa!BNm=)=?AkUKQ&
zz=yhxp>k6;(pFtG8nN6ZqvZK~!DRW7Q_ti_$(RK|%Set{OXFdl<rkfoowdTNPXRC!
z==fs-z;OCm0A}@Hyj6s?!XOR6J_9U&)^Qww%rNo*{Dr;)_)YiX9QP80ThVQtxq%B)
z_4vVqL+$Xnii`FmfS!&|0^<)bzdS<r4lY7(pk?&>$h|)LYJhSN`sn8Yavt^3FKCT*
zH2N9GWzy?L9!nGRS4~-Zt5X^qVBgih8`cl#?&BgP^CLR0Q|yP at 7&gaLO87NI0N>!v
zL-zP|iHiNU2wU#1jFTV=-RXt$RC%fuD0gC8scy1ZsUX-+8|5UB<s=IC%6`<TTwGf%
zZN$N at P_p88(~^p!w!bZcu+;6wW&QfXyqKD)Rz-Dot0oubo3*AtGvkZ7xw);Xm}|_6
z*?BpS%!{C8qRM`^3zeo&qSB3{9qFs2lK64ZMIXynEEC;bDM<q?7=+zaRa!EXv1mj6
zt(Uf<Xyc7wrvVrMDjYUMEIJ!1hPCz0jm--K{AQR0txz^0Jr3L_spqhLXlS!?e*NO+
z^7^KJbM^Jr3jn|CZ{o2U^w)I>hiHI{mJsq+en>kUFzEaE=P*d%Ej-af!L+k<x?m}@
zU}esl=JytR_qLg}CQN22c14-QV%((;ZU*1#iZ+(I9E2^JxuKznC7lyTr6Z^%gHel7
z8?Nb$Y%JT6UtT%?+A1S93iVITjt<xpVm1rhqQG+u_!v7Ryl4P_nq4KuX90?n*z+sw
zi0~zLhwycFkMK+E0pUCB5h<o9Wc~qRpHTiOVV_a{1z~py|C+G-gx at 0UA>l`aeN5r=
z|5nz6vq`apL-|gBUL3Evnfj<Yn$ZGGMN5+WO1;}olYyD8LJpIByn5LzHTH<vS8Dt}
xDD)?No?#{8mQ?jEDO8GrWRt_4REb7gmRjwoA==4gMhmPYuc*n);QzN){Tr at fQzHNX

literal 0
HcmV?d00001

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wat
new file mode 100644
index 00000000000000..ccacc0fab12918
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wat
@@ -0,0 +1,63 @@
+(module
+  (type (;0;) (func (param i64 i32 i32) (result i32)))
+  (import "env" "__linear_memory" (memory (;0;) i64 0))
+  (import "env" "__stack_pointer" (global (;0;) (mut i64)))
+  (func $_Z3fooPKijb (type 0) (param i64 i32 i32) (result i32)
+    (local i64 i64 i64 i32 i32 i32 i32 i32 i32 i32 i32)
+    global.get 0
+    local.set 3
+    i64.const 32
+    local.set 4
+    local.get 3
+    local.get 4
+    i64.sub
+    local.set 5
+    local.get 5
+    local.get 0
+    i64.store offset=16
+    local.get 5
+    local.get 1
+    i32.store offset=12
+    local.get 2
+    local.set 6
+    local.get 5
+    local.get 6
+    i32.store8 offset=11
+    local.get 5
+    i32.load8_u offset=11
+    local.set 7
+    i32.const 1
+    local.set 8
+    local.get 7
+    local.get 8
+    i32.and
+    local.set 9
+    block  ;; label = @1
+      block  ;; label = @2
+        local.get 9
+        i32.eqz
+        br_if 0 (;@2;)
+        i32.const 7
+        local.set 10
+        local.get 5
+        local.get 10
+        i32.store offset=4
+        i32.const 7
+        local.set 11
+        local.get 5
+        local.get 11
+        i32.store offset=28
+        br 1 (;@1;)
+      end
+      local.get 5
+      i32.load offset=12
+      local.set 12
+      local.get 5
+      local.get 12
+      i32.store offset=28
+    end
+    local.get 5
+    i32.load offset=28
+    local.set 13
+    local.get 13
+    return))
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test.cpp b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test.cpp
new file mode 100644
index 00000000000000..5cf39f47735844
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test.cpp
@@ -0,0 +1,9 @@
+using INTPTR = const int *;
+int foo(INTPTR ParamPtr, unsigned ParamUnsigned, bool ParamBool) {
+  if (ParamBool) {
+    typedef int INTEGER;
+    const INTEGER CONSTANT = 7;
+    return CONSTANT;
+  }
+  return ParamUnsigned;
+}
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt
new file mode 100644
index 00000000000000..9e6c8dc6aa845d
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt
@@ -0,0 +1,54 @@
+LLVM WebAssembly limitations
+----------------------------
+LLVM does not support any conversion between the binary format (.wasm)
+and the text format (.wat):
+
+  .wasm -> .wat
+  .wat  -> .wasm
+
+WebAssembly external tools
+--------------------------
+These tools are intended for use in (or for development of) toolchains
+or other systems that want to manipulate WebAssembly files.
+
+  Development of WebAssembly and associated infrastructure
+  https://github.com/WebAssembly
+
+  WABT: The WebAssembly Binary Toolkit
+  https://github.com/WebAssembly/wabt
+
+  wasm2wat — translate from the binary format to the text format
+  https://webassembly.github.io/wabt/doc/wasm2wat.1.html
+
+  wat2wasm — translate from WebAssembly text format to the WebAssembly binary format
+  https://webassembly.github.io/wabt/doc/wat2wasm.1.html
+
+How to generate .wasm from .cpp
+-------------------------------
+Each test includes its C++ source. To generate the .wasm for any of
+the tests (ie. hello-world.cpp):
+
+For target=wasm64
+  clang --target=wasm64 -c -w -g -O0 -o hello-world.wasm hello-world.cpp
+
+or
+
+For target=wasm32
+  clang --target=wasm32 -c -w -g -O0 -o hello-world.wasm hello-world.cpp
+
+How to generate .wasm from .wat
+-------------------------------
+Using the 'wasm2wat' and 'wat2wasm' (WABT: The WebAssembly Binary Toolkit),
+we can generate the WebAssembly text format file.
+
+For target=wasm64
+  wasm2wat hello-world.wasm --enable-memory64 -o hello-world.wat
+
+For target=wasm32
+  wat2wasm hello-world.wat -o hello-world.wasm
+
+Notes:
+------
+* The tests run the .wasm file (target=wasm64).
+* The .wat files were generated using WABT wasm2wat tool and are included
+  only for extra information.

>From 6663926c9a1f35f732450f80d4894b15094e3282 Mon Sep 17 00:00:00 2001
From: Carlos Alberto Enciso <carlos.alberto.enciso at gmail.com>
Date: Thu, 22 Feb 2024 06:32:14 +0000
Subject: [PATCH 2/7] [llvm-debuginfo-analyzer] Add support for WebAssembly
 binary format.

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 and conversion between .wasm and .wat.

- Fix clang-format reported issue.
---
 .../DebugInfo/LogicalView/Readers/LVBinaryReader.cpp   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp b/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp
index d219b8abe1ae98..871c1bed039877 100644
--- a/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp
@@ -188,11 +188,11 @@ void LVBinaryReader::mapVirtualAddress(const object::ObjectFile &Obj) {
         (*SectionNameOrErr).equals("CODE") ||
         (*SectionNameOrErr).equals(".code"))
       DotTextSectionIndex = Section.getIndex();
-      // If the object is WebAssembly, update the address offset that
-      // will be added to DWARF DW_AT_* attributes.
-      if (Obj.isWasm()) {
-        WasmOffset = Section.getAddress();
-      }
+    // If the object is WebAssembly, update the address offset that
+    // will be added to DWARF DW_AT_* attributes.
+    if (Obj.isWasm()) {
+      WasmOffset = Section.getAddress();
+    }
   }
 
   // Process the symbol table.

>From 1c77be0d90922e18c5be15c01606e72534db227f Mon Sep 17 00:00:00 2001
From: Carlos Alberto Enciso <carlos.alberto.enciso at gmail.com>
Date: Mon, 26 Feb 2024 14:01:49 +0000
Subject: [PATCH 3/7] [llvm-debuginfo-analyzer] Add support for WebAssembly
 binary format.

Add support for the WebAssembly binary format and be able to
generate logical views.

https://github.com/llvm/llvm-project/issues/69181

- Use '--target=wasm32' for documentation and tests.
---
 .../CommandGuide/llvm-debuginfo-analyzer.rst  |  37 ++-
 .../01-wasm-print-basic-details.test          |  22 +-
 .../01-wasm-select-logical-elements.test      |  13 +-
 .../WebAssembly/02-wasm-logical-lines.test    |  20 +-
 .../06-wasm-full-logical-view.test            | 212 +++++++++---------
 .../WebAssembly/Inputs/hello-world-clang.wasm | Bin 1414 -> 1333 bytes
 .../WebAssembly/Inputs/hello-world-clang.wat  |  25 +--
 .../WebAssembly/Inputs/pr-43860-clang.wasm    | Bin 1613 -> 1545 bytes
 .../WebAssembly/Inputs/pr-43860-clang.wat     |  10 +-
 .../WebAssembly/Inputs/pr-44884-clang.wasm    | Bin 1882 -> 1783 bytes
 .../WebAssembly/Inputs/pr-44884-clang.wat     |  20 +-
 .../WebAssembly/Inputs/pr-46466-clang.wasm    | Bin 1180 -> 1117 bytes
 .../WebAssembly/Inputs/pr-46466-clang.wat     |   6 +-
 .../WebAssembly/Inputs/test-clang.wasm        | Bin 1459 -> 1394 bytes
 .../WebAssembly/Inputs/test-clang.wat         |  26 +--
 .../WebAssembly/README.txt                    |   2 +-
 16 files changed, 192 insertions(+), 201 deletions(-)

diff --git a/llvm/docs/CommandGuide/llvm-debuginfo-analyzer.rst b/llvm/docs/CommandGuide/llvm-debuginfo-analyzer.rst
index 82fad8ce4d5192..00c070cedb479c 100644
--- a/llvm/docs/CommandGuide/llvm-debuginfo-analyzer.rst
+++ b/llvm/docs/CommandGuide/llvm-debuginfo-analyzer.rst
@@ -1957,7 +1957,7 @@ WEBASSEMBLY SUPPORT
 ~~~~~~~~~~~~~~~~~~~
 The below example is used to show the WebAssembly output generated by
 :program:`llvm-debuginfo-analyzer`. We compiled the example for a
-WebAssembly 64-bit target with Clang (-O0 -g --target=wasm64):
+WebAssembly 32-bit target with Clang (-O0 -g --target=wasm32):
 
 .. code-block:: c++
 
@@ -2015,7 +2015,7 @@ the element.
   [004]                   {Code} 'local.set	10'
   [004]                   {Code} 'local.get	5'
   [004]                   {Code} 'local.get	10'
-  [004]                   {Code} 'i32.store	4'
+  [004]                   {Code} 'i32.store	12'
   [004]     6             {Line}
   [004]                   {Code} 'i32.const	7'
   [004]                   {Code} 'local.set	11'
@@ -2027,31 +2027,31 @@ the element.
   [004]                   {Code} 'end'
   [003]     4           {TypeAlias} 'INTEGER' -> 'int'
   [003]     2           {Line}
-  [003]                 {Code} 'block   	unknown_type'
-  [003]                 {Code} 'i64.mul'
-  [003]                 {Code} 'throw   	127'
+  [003]                 {Code} 'nop'
+  [003]                 {Code} 'end'
+  [003]                 {Code} 'i64.div_s'
   [003]                 {Code} 'global.get	0'
   [003]                 {Code} 'local.set	3'
-  [003]                 {Code} 'i64.const	32'
+  [003]                 {Code} 'i32.const	32'
   [003]                 {Code} 'local.set	4'
   [003]                 {Code} 'local.get	3'
   [003]                 {Code} 'local.get	4'
-  [003]                 {Code} 'i64.sub'
+  [003]                 {Code} 'i32.sub'
   [003]                 {Code} 'local.set	5'
   [003]                 {Code} 'local.get	5'
   [003]                 {Code} 'local.get	0'
-  [003]                 {Code} 'i64.store	16'
+  [003]                 {Code} 'i32.store	24'
   [003]                 {Code} 'local.get	5'
   [003]                 {Code} 'local.get	1'
-  [003]                 {Code} 'i32.store	12'
+  [003]                 {Code} 'i32.store	20'
   [003]                 {Code} 'local.get	2'
   [003]                 {Code} 'local.set	6'
   [003]                 {Code} 'local.get	5'
   [003]                 {Code} 'local.get	6'
-  [003]                 {Code} 'i32.store8	11'
+  [003]                 {Code} 'i32.store8	19'
   [003]     3           {Line}
   [003]                 {Code} 'local.get	5'
-  [003]                 {Code} 'i32.load8_u	11'
+  [003]                 {Code} 'i32.load8_u	19'
   [003]                 {Code} 'local.set	7'
   [003]     3           {Line}
   [003]                 {Code} 'i32.const	1'
@@ -2067,7 +2067,7 @@ the element.
   [003]                 {Code} 'br_if   	0'
   [003]     8           {Line}
   [003]                 {Code} 'local.get	5'
-  [003]                 {Code} 'i32.load	12'
+  [003]                 {Code} 'i32.load	20'
   [003]                 {Code} 'local.set	12'
   [003]     8           {Line}
   [003]                 {Code} 'local.get	5'
@@ -2107,13 +2107,12 @@ layout and given the number of matches.
   [001]           {CompileUnit} 'test.cpp'
   [003]           {Code} 'block'
   [003]           {Code} 'block'
-  [003]           {Code} 'block   	unknown_type'
-  [003]           {Code} 'i32.store	12'
+  [004]           {Code} 'i32.store	12'
+  [003]           {Code} 'i32.store	20'
+  [003]           {Code} 'i32.store	24'
   [004]           {Code} 'i32.store	28'
   [003]           {Code} 'i32.store	28'
-  [004]           {Code} 'i32.store	4'
-  [003]           {Code} 'i32.store8	11'
-  [003]           {Code} 'i64.store	16'
+  [003]           {Code} 'i32.store8	19'
 
   -----------------------------
   Element      Total    Printed
@@ -2121,9 +2120,9 @@ layout and given the number of matches.
   Scopes           3          0
   Symbols          4          0
   Types            2          0
-  Lines           62          9
+  Lines           62          8
   -----------------------------
-  Total           71          9
+  Total           71          8
 
 COMPARISON MODE
 ^^^^^^^^^^^^^^^
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
index 10b44028bfbfb9..ddb9c34fca130c 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
@@ -45,7 +45,7 @@
 ; ONE-NEXT: [004]                   {Code} 'local.set	10'
 ; ONE-NEXT: [004]                   {Code} 'local.get	5'
 ; ONE-NEXT: [004]                   {Code} 'local.get	10'
-; ONE-NEXT: [004]                   {Code} 'i32.store	4'
+; ONE-NEXT: [004]                   {Code} 'i32.store	12'
 ; ONE-NEXT: [004]     6             {Line}
 ; ONE-NEXT: [004]                   {Code} 'i32.const	7'
 ; ONE-NEXT: [004]                   {Code} 'local.set	11'
@@ -57,31 +57,31 @@
 ; ONE-NEXT: [004]                   {Code} 'end'
 ; ONE-NEXT: [003]     4           {TypeAlias} 'INTEGER' -> 'int'
 ; ONE-NEXT: [003]     2           {Line}
-; ONE-NEXT: [003]                 {Code} 'block   	unknown_type'
-; ONE-NEXT: [003]                 {Code} 'i64.mul'
-; ONE-NEXT: [003]                 {Code} 'throw   	127'
+; ONE-NEXT: [003]                 {Code} 'nop'
+; ONE-NEXT: [003]                 {Code} 'end'
+; ONE-NEXT: [003]                 {Code} 'i64.div_s'
 ; ONE-NEXT: [003]                 {Code} 'global.get	0'
 ; ONE-NEXT: [003]                 {Code} 'local.set	3'
-; ONE-NEXT: [003]                 {Code} 'i64.const	32'
+; ONE-NEXT: [003]                 {Code} 'i32.const	32'
 ; ONE-NEXT: [003]                 {Code} 'local.set	4'
 ; ONE-NEXT: [003]                 {Code} 'local.get	3'
 ; ONE-NEXT: [003]                 {Code} 'local.get	4'
-; ONE-NEXT: [003]                 {Code} 'i64.sub'
+; ONE-NEXT: [003]                 {Code} 'i32.sub'
 ; ONE-NEXT: [003]                 {Code} 'local.set	5'
 ; ONE-NEXT: [003]                 {Code} 'local.get	5'
 ; ONE-NEXT: [003]                 {Code} 'local.get	0'
-; ONE-NEXT: [003]                 {Code} 'i64.store	16'
+; ONE-NEXT: [003]                 {Code} 'i32.store	24'
 ; ONE-NEXT: [003]                 {Code} 'local.get	5'
 ; ONE-NEXT: [003]                 {Code} 'local.get	1'
-; ONE-NEXT: [003]                 {Code} 'i32.store	12'
+; ONE-NEXT: [003]                 {Code} 'i32.store	20'
 ; ONE-NEXT: [003]                 {Code} 'local.get	2'
 ; ONE-NEXT: [003]                 {Code} 'local.set	6'
 ; ONE-NEXT: [003]                 {Code} 'local.get	5'
 ; ONE-NEXT: [003]                 {Code} 'local.get	6'
-; ONE-NEXT: [003]                 {Code} 'i32.store8	11'
+; ONE-NEXT: [003]                 {Code} 'i32.store8	19'
 ; ONE-NEXT: [003]     3           {Line}
 ; ONE-NEXT: [003]                 {Code} 'local.get	5'
-; ONE-NEXT: [003]                 {Code} 'i32.load8_u	11'
+; ONE-NEXT: [003]                 {Code} 'i32.load8_u	19'
 ; ONE-NEXT: [003]                 {Code} 'local.set	7'
 ; ONE-NEXT: [003]     3           {Line}
 ; ONE-NEXT: [003]                 {Code} 'i32.const	1'
@@ -97,7 +97,7 @@
 ; ONE-NEXT: [003]                 {Code} 'br_if   	0'
 ; ONE-NEXT: [003]     8           {Line}
 ; ONE-NEXT: [003]                 {Code} 'local.get	5'
-; ONE-NEXT: [003]                 {Code} 'i32.load	12'
+; ONE-NEXT: [003]                 {Code} 'i32.load	20'
 ; ONE-NEXT: [003]                 {Code} 'local.set	12'
 ; ONE-NEXT: [003]     8           {Line}
 ; ONE-NEXT: [003]                 {Code} 'local.get	5'
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
index 44602dc7ac2cec..3a2443152236d8 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
@@ -32,13 +32,12 @@
 ; ONE-NEXT: [001]           {CompileUnit} 'test.cpp'
 ; ONE-NEXT: [003]           {Code} 'block'
 ; ONE-NEXT: [003]           {Code} 'block'
-; ONE-NEXT: [003]           {Code} 'block   	unknown_type'
-; ONE-NEXT: [003]           {Code} 'i32.store	12'
+; ONE-NEXT: [004]           {Code} 'i32.store	12'
+; ONE-NEXT: [003]           {Code} 'i32.store	20'
+; ONE-NEXT: [003]           {Code} 'i32.store	24'
 ; ONE-NEXT: [004]           {Code} 'i32.store	28'
 ; ONE-NEXT: [003]           {Code} 'i32.store	28'
-; ONE-NEXT: [004]           {Code} 'i32.store	4'
-; ONE-NEXT: [003]           {Code} 'i32.store8	11'
-; ONE-NEXT: [003]           {Code} 'i64.store	16'
+; ONE-NEXT: [003]           {Code} 'i32.store8	19'
 ; ONE-EMPTY:
 ; ONE-NEXT: -----------------------------
 ; ONE-NEXT: Element      Total    Printed
@@ -46,9 +45,9 @@
 ; ONE-NEXT: Scopes           3          0
 ; ONE-NEXT: Symbols          4          0
 ; ONE-NEXT: Types            2          0
-; ONE-NEXT: Lines           62          9
+; ONE-NEXT: Lines           62          8
 ; ONE-NEXT: -----------------------------
-; ONE-NEXT: Total           71          9
+; ONE-NEXT: Total           71          8
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level \
 ; RUN:                         --select-regex --select-nocase \
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
index af55d7812115a6..2c77c8b037d0ff 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
@@ -27,21 +27,15 @@
 ; ONE-NEXT: [002]               {Producer} 'clang version 19{{.*}}'
 ; ONE-NEXT: [002]     3         {Function} extern not_inlined 'main' -> 'int'
 ; ONE-NEXT: [003]     4           {Line}
-; ONE-NEXT: [003]                 {Code} 'else'
-; ONE-NEXT: [003]                 {Code} 'loop    	i64'
 ; ONE-NEXT: [003]                 {Code} 'nop'
-; ONE-NEXT: [003]                 {Code} 'i64.div_s'
-; ONE-NEXT: [003]                 {Code} 'block   	i64'
-; ONE-NEXT: [003]                 {Code} 'nop'
-; ONE-NEXT: [003]                 {Code} 'i64.div_s'
-; ONE-NEXT: [003]                 {Code} 'block   	i64'
+; ONE-NEXT: [003]                 {Code} 'rethrow 	127'
 ; ONE-NEXT: [003]                 {Code} 'global.get	0'
 ; ONE-NEXT: [003]                 {Code} 'local.set	0'
-; ONE-NEXT: [003]                 {Code} 'i64.const	16'
+; ONE-NEXT: [003]                 {Code} 'i32.const	16'
 ; ONE-NEXT: [003]                 {Code} 'local.set	1'
 ; ONE-NEXT: [003]                 {Code} 'local.get	0'
 ; ONE-NEXT: [003]                 {Code} 'local.get	1'
-; ONE-NEXT: [003]                 {Code} 'i64.sub'
+; ONE-NEXT: [003]                 {Code} 'i32.sub'
 ; ONE-NEXT: [003]                 {Code} 'local.set	2'
 ; ONE-NEXT: [003]                 {Code} 'local.get	2'
 ; ONE-NEXT: [003]                 {Code} 'global.set	0'
@@ -51,9 +45,9 @@
 ; ONE-NEXT: [003]                 {Code} 'local.get	3'
 ; ONE-NEXT: [003]                 {Code} 'i32.store	12'
 ; ONE-NEXT: [003]     5           {Line}
-; ONE-NEXT: [003]                 {Code} 'i64.const	0'
+; ONE-NEXT: [003]                 {Code} 'i32.const	0'
 ; ONE-NEXT: [003]                 {Code} 'local.set	4'
-; ONE-NEXT: [003]                 {Code} 'i64.const	0'
+; ONE-NEXT: [003]                 {Code} 'i32.const	0'
 ; ONE-NEXT: [003]                 {Code} 'local.set	5'
 ; ONE-NEXT: [003]                 {Code} 'local.get	4'
 ; ONE-NEXT: [003]                 {Code} 'local.get	5'
@@ -62,11 +56,11 @@
 ; ONE-NEXT: [003]     6           {Line}
 ; ONE-NEXT: [003]                 {Code} 'i32.const	0'
 ; ONE-NEXT: [003]                 {Code} 'local.set	6'
-; ONE-NEXT: [003]                 {Code} 'i64.const	16'
+; ONE-NEXT: [003]                 {Code} 'i32.const	16'
 ; ONE-NEXT: [003]                 {Code} 'local.set	7'
 ; ONE-NEXT: [003]                 {Code} 'local.get	2'
 ; ONE-NEXT: [003]                 {Code} 'local.get	7'
-; ONE-NEXT: [003]                 {Code} 'i64.add'
+; ONE-NEXT: [003]                 {Code} 'i32.add'
 ; ONE-NEXT: [003]                 {Code} 'local.set	8'
 ; ONE-NEXT: [003]                 {Code} 'local.get	8'
 ; ONE-NEXT: [003]                 {Code} 'global.set	0'
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
index 9f4c95eea093f6..21978a93afd5cf 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
@@ -30,109 +30,109 @@
 ; ONE-NEXT: [0x000000000b][002]                {Producer} 'clang version 19{{.*}}'
 ; ONE-NEXT:                                    {Directory} '{{.*}}/general'
 ; ONE-NEXT:                                    {File} 'test.cpp'
-; ONE-NEXT:                                    {Public} 'foo' [0x0000000002:0x0000000081]
-; ONE-NEXT: [0x000000000b][002]                {Range} Lines 2:9 [0x0000000002:0x0000000081]
-; ONE-NEXT: [0x00000000bf][002]                {BaseType} 'bool'
-; ONE-NEXT: [0x000000009c][002]                {BaseType} 'int'
-; ONE-NEXT: [0x00000000b8][002]                {BaseType} 'unsigned int'
+; ONE-NEXT:                                    {Public} 'foo' [0x0000000002:0x000000007f]
+; ONE-NEXT: [0x000000000b][002]                {Range} Lines 2:9 [0x0000000002:0x000000007f]
+; ONE-NEXT: [0x00000000b3][002]                {BaseType} 'bool'
+; ONE-NEXT: [0x0000000090][002]                {BaseType} 'int'
+; ONE-NEXT: [0x00000000ac][002]                {BaseType} 'unsigned int'
 ; ONE-EMPTY:
-; ONE-NEXT: [0x00000000a3][002]   {Source} '{{.*}}/general/test.cpp'
-; ONE-NEXT: [0x00000000a3][002]      1         {TypeAlias} 'INTPTR' -> [0x00000000ae]'* const int'
-; ONE-NEXT: [0x000000002a][002]      2         {Function} extern not_inlined 'foo' -> [0x000000009c]'int'
-; ONE-NEXT: [0x000000002a][003]                  {Range} Lines 2:9 [0x0000000002:0x0000000081]
-; ONE-NEXT: [0x000000002a][003]                  {Linkage}  0x3 '_Z3fooPKijb'
-; ONE-NEXT: [0x0000000074][003]                  {Block}
-; ONE-NEXT: [0x0000000074][004]                    {Range} Lines 5:0 [0x000000004e:0x0000000066]
-; ONE-NEXT: [0x0000000081][004]      5             {Variable} 'CONSTANT' -> [0x00000000c6]'const INTEGER'
-; ONE-NEXT: [0x0000000081][005]                      {Coverage} 100.00%
-; ONE-NEXT: [0x0000000082][005]                      {Location}
-; ONE-NEXT: [0x0000000082][006]                        {Entry} fbreg 4
-; ONE-NEXT: [0x000000004e][004]      5             {Line} {NewStatement} '{{.*}}/general/test.cpp'
-; ONE-NEXT: [0x000000004e][004]                    {Code} 'i32.const	7'
-; ONE-NEXT: [0x0000000050][004]                    {Code} 'local.set	10'
-; ONE-NEXT: [0x0000000052][004]                    {Code} 'local.get	5'
-; ONE-NEXT: [0x0000000054][004]                    {Code} 'local.get	10'
-; ONE-NEXT: [0x0000000056][004]                    {Code} 'i32.store	4'
-; ONE-NEXT: [0x0000000059][004]      6             {Line} {NewStatement} '{{.*}}/general/test.cpp'
-; ONE-NEXT: [0x0000000059][004]                    {Code} 'i32.const	7'
-; ONE-NEXT: [0x000000005b][004]                    {Code} 'local.set	11'
-; ONE-NEXT: [0x000000005d][004]                    {Code} 'local.get	5'
-; ONE-NEXT: [0x000000005f][004]                    {Code} 'local.get	11'
-; ONE-NEXT: [0x0000000061][004]                    {Code} 'i32.store	28'
-; ONE-NEXT: [0x0000000064][004]                    {Code} 'br      	1'
-; ONE-NEXT: [0x0000000066][004]      0             {Line} '{{.*}}/general/test.cpp'
-; ONE-NEXT: [0x0000000066][004]                    {Code} 'end'
-; ONE-NEXT: [0x0000000066][003]      2           {Parameter} 'ParamBool' -> [0x00000000bf]'bool'
-; ONE-NEXT: [0x0000000066][004]                    {Coverage} 100.00%
-; ONE-NEXT: [0x0000000067][004]                    {Location}
-; ONE-NEXT: [0x0000000067][005]                      {Entry} fbreg 11
-; ONE-NEXT: [0x000000004a][003]      2           {Parameter} 'ParamPtr' -> [0x00000000a3]'INTPTR'
-; ONE-NEXT: [0x000000004a][004]                    {Coverage} 100.00%
-; ONE-NEXT: [0x000000004b][004]                    {Location}
-; ONE-NEXT: [0x000000004b][005]                      {Entry} fbreg 16
-; ONE-NEXT: [0x0000000058][003]      2           {Parameter} 'ParamUnsigned' -> [0x00000000b8]'unsigned int'
-; ONE-NEXT: [0x0000000058][004]                    {Coverage} 100.00%
-; ONE-NEXT: [0x0000000059][004]                    {Location}
-; ONE-NEXT: [0x0000000059][005]                      {Entry} fbreg 12
-; ONE-NEXT: [0x0000000090][003]      4           {TypeAlias} 'INTEGER' -> [0x000000009c]'int'
+; ONE-NEXT: [0x0000000097][002]   {Source} '{{.*}}general/test.cpp'
+; ONE-NEXT: [0x0000000097][002]      1         {TypeAlias} 'INTPTR' -> [0x00000000a2]'* const int'
+; ONE-NEXT: [0x0000000026][002]      2         {Function} extern not_inlined 'foo' -> [0x0000000090]'int'
+; ONE-NEXT: [0x0000000026][003]                  {Range} Lines 2:9 [0x0000000002:0x000000007f]
+; ONE-NEXT: [0x0000000026][003]                  {Linkage}  0x3 '_Z3fooPKijb'
+; ONE-NEXT: [0x000000006c][003]                  {Block}
+; ONE-NEXT: [0x000000006c][004]                    {Range} Lines 5:0 [0x000000004c:0x0000000064]
+; ONE-NEXT: [0x0000000075][004]      5             {Variable} 'CONSTANT' -> [0x00000000ba]'const INTEGER'
+; ONE-NEXT: [0x0000000075][005]                      {Coverage} 100.00%
+; ONE-NEXT: [0x0000000076][005]                      {Location}
+; ONE-NEXT: [0x0000000076][006]                        {Entry} fbreg 12
+; ONE-NEXT: [0x000000004c][004]      5             {Line} {NewStatement} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x000000004c][004]                    {Code} 'i32.const	7'
+; ONE-NEXT: [0x000000004e][004]                    {Code} 'local.set	10'
+; ONE-NEXT: [0x0000000050][004]                    {Code} 'local.get	5'
+; ONE-NEXT: [0x0000000052][004]                    {Code} 'local.get	10'
+; ONE-NEXT: [0x0000000054][004]                    {Code} 'i32.store	12'
+; ONE-NEXT: [0x0000000057][004]      6             {Line} {NewStatement} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000057][004]                    {Code} 'i32.const	7'
+; ONE-NEXT: [0x0000000059][004]                    {Code} 'local.set	11'
+; ONE-NEXT: [0x000000005b][004]                    {Code} 'local.get	5'
+; ONE-NEXT: [0x000000005d][004]                    {Code} 'local.get	11'
+; ONE-NEXT: [0x000000005f][004]                    {Code} 'i32.store	28'
+; ONE-NEXT: [0x0000000062][004]                    {Code} 'br      	1'
+; ONE-NEXT: [0x0000000064][004]      0             {Line} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000064][004]                    {Code} 'end'
+; ONE-NEXT: [0x000000005e][003]      2           {Parameter} 'ParamBool' -> [0x00000000b3]'bool'
+; ONE-NEXT: [0x000000005e][004]                    {Coverage} 100.00%
+; ONE-NEXT: [0x000000005f][004]                    {Location}
+; ONE-NEXT: [0x000000005f][005]                      {Entry} fbreg 19
+; ONE-NEXT: [0x0000000042][003]      2           {Parameter} 'ParamPtr' -> [0x0000000097]'INTPTR'
+; ONE-NEXT: [0x0000000042][004]                    {Coverage} 100.00%
+; ONE-NEXT: [0x0000000043][004]                    {Location}
+; ONE-NEXT: [0x0000000043][005]                      {Entry} fbreg 24
+; ONE-NEXT: [0x0000000050][003]      2           {Parameter} 'ParamUnsigned' -> [0x00000000ac]'unsigned int'
+; ONE-NEXT: [0x0000000050][004]                    {Coverage} 100.00%
+; ONE-NEXT: [0x0000000051][004]                    {Location}
+; ONE-NEXT: [0x0000000051][005]                      {Entry} fbreg 20
+; ONE-NEXT: [0x0000000084][003]      4           {TypeAlias} 'INTEGER' -> [0x0000000090]'int'
 ; ONE-NEXT: [0x0000000002][003]      2           {Line} {NewStatement} '{{.*}}/general/test.cpp'
-; ONE-NEXT: [0x0000000002][003]                  {Code} 'block   	unknown_type'
-; ONE-NEXT: [0x0000000004][003]                  {Code} 'i64.mul'
-; ONE-NEXT: [0x0000000005][003]                  {Code} 'throw   	127'
-; ONE-NEXT: [0x0000000007][003]                  {Code} 'global.get	0'
-; ONE-NEXT: [0x000000000d][003]                  {Code} 'local.set	3'
-; ONE-NEXT: [0x000000000f][003]                  {Code} 'i64.const	32'
-; ONE-NEXT: [0x0000000011][003]                  {Code} 'local.set	4'
-; ONE-NEXT: [0x0000000013][003]                  {Code} 'local.get	3'
-; ONE-NEXT: [0x0000000015][003]                  {Code} 'local.get	4'
-; ONE-NEXT: [0x0000000017][003]                  {Code} 'i64.sub'
-; ONE-NEXT: [0x0000000018][003]                  {Code} 'local.set	5'
-; ONE-NEXT: [0x000000001a][003]                  {Code} 'local.get	5'
-; ONE-NEXT: [0x000000001c][003]                  {Code} 'local.get	0'
-; ONE-NEXT: [0x000000001e][003]                  {Code} 'i64.store	16'
-; ONE-NEXT: [0x0000000021][003]                  {Code} 'local.get	5'
-; ONE-NEXT: [0x0000000023][003]                  {Code} 'local.get	1'
-; ONE-NEXT: [0x0000000025][003]                  {Code} 'i32.store	12'
-; ONE-NEXT: [0x0000000028][003]                  {Code} 'local.get	2'
-; ONE-NEXT: [0x000000002a][003]                  {Code} 'local.set	6'
-; ONE-NEXT: [0x000000002c][003]                  {Code} 'local.get	5'
-; ONE-NEXT: [0x000000002e][003]                  {Code} 'local.get	6'
-; ONE-NEXT: [0x0000000030][003]                  {Code} 'i32.store8	11'
-; ONE-NEXT: [0x0000000033][003]      3           {Line} {NewStatement} {PrologueEnd} '{{.*}}/general/test.cpp'
-; ONE-NEXT: [0x0000000033][003]                  {Code} 'local.get	5'
-; ONE-NEXT: [0x0000000035][003]                  {Code} 'i32.load8_u	11'
-; ONE-NEXT: [0x0000000038][003]                  {Code} 'local.set	7'
-; ONE-NEXT: [0x000000003a][003]      3           {Line} '{{.*}}/general/test.cpp'
-; ONE-NEXT: [0x000000003a][003]                  {Code} 'i32.const	1'
-; ONE-NEXT: [0x000000003c][003]                  {Code} 'local.set	8'
-; ONE-NEXT: [0x000000003e][003]                  {Code} 'local.get	7'
-; ONE-NEXT: [0x0000000040][003]                  {Code} 'local.get	8'
-; ONE-NEXT: [0x0000000042][003]                  {Code} 'i32.and'
-; ONE-NEXT: [0x0000000043][003]                  {Code} 'local.set	9'
+; ONE-NEXT: [0x0000000002][003]                  {Code} 'nop'
+; ONE-NEXT: [0x0000000003][003]                  {Code} 'end'
+; ONE-NEXT: [0x0000000004][003]                  {Code} 'i64.div_s'
+; ONE-NEXT: [0x0000000005][003]                  {Code} 'global.get	0'
+; ONE-NEXT: [0x000000000b][003]                  {Code} 'local.set	3'
+; ONE-NEXT: [0x000000000d][003]                  {Code} 'i32.const	32'
+; ONE-NEXT: [0x000000000f][003]                  {Code} 'local.set	4'
+; ONE-NEXT: [0x0000000011][003]                  {Code} 'local.get	3'
+; ONE-NEXT: [0x0000000013][003]                  {Code} 'local.get	4'
+; ONE-NEXT: [0x0000000015][003]                  {Code} 'i32.sub'
+; ONE-NEXT: [0x0000000016][003]                  {Code} 'local.set	5'
+; ONE-NEXT: [0x0000000018][003]                  {Code} 'local.get	5'
+; ONE-NEXT: [0x000000001a][003]                  {Code} 'local.get	0'
+; ONE-NEXT: [0x000000001c][003]                  {Code} 'i32.store	24'
+; ONE-NEXT: [0x000000001f][003]                  {Code} 'local.get	5'
+; ONE-NEXT: [0x0000000021][003]                  {Code} 'local.get	1'
+; ONE-NEXT: [0x0000000023][003]                  {Code} 'i32.store	20'
+; ONE-NEXT: [0x0000000026][003]                  {Code} 'local.get	2'
+; ONE-NEXT: [0x0000000028][003]                  {Code} 'local.set	6'
+; ONE-NEXT: [0x000000002a][003]                  {Code} 'local.get	5'
+; ONE-NEXT: [0x000000002c][003]                  {Code} 'local.get	6'
+; ONE-NEXT: [0x000000002e][003]                  {Code} 'i32.store8	19'
+; ONE-NEXT: [0x0000000031][003]      3           {Line} {NewStatement} {PrologueEnd} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000031][003]                  {Code} 'local.get	5'
+; ONE-NEXT: [0x0000000033][003]                  {Code} 'i32.load8_u	19'
+; ONE-NEXT: [0x0000000036][003]                  {Code} 'local.set	7'
+; ONE-NEXT: [0x0000000038][003]      3           {Line} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000038][003]                  {Code} 'i32.const	1'
+; ONE-NEXT: [0x000000003a][003]                  {Code} 'local.set	8'
+; ONE-NEXT: [0x000000003c][003]                  {Code} 'local.get	7'
+; ONE-NEXT: [0x000000003e][003]                  {Code} 'local.get	8'
+; ONE-NEXT: [0x0000000040][003]                  {Code} 'i32.and'
+; ONE-NEXT: [0x0000000041][003]                  {Code} 'local.set	9'
+; ONE-NEXT: [0x0000000043][003]                  {Code} 'block'
 ; ONE-NEXT: [0x0000000045][003]                  {Code} 'block'
-; ONE-NEXT: [0x0000000047][003]                  {Code} 'block'
-; ONE-NEXT: [0x0000000049][003]                  {Code} 'local.get	9'
-; ONE-NEXT: [0x000000004b][003]                  {Code} 'i32.eqz'
-; ONE-NEXT: [0x000000004c][003]                  {Code} 'br_if   	0'
-; ONE-NEXT: [0x0000000067][003]      8           {Line} {NewStatement} '{{.*}}/general/test.cpp'
-; ONE-NEXT: [0x0000000067][003]                  {Code} 'local.get	5'
-; ONE-NEXT: [0x0000000069][003]                  {Code} 'i32.load	12'
-; ONE-NEXT: [0x000000006c][003]                  {Code} 'local.set	12'
-; ONE-NEXT: [0x000000006e][003]      8           {Line} '{{.*}}/general/test.cpp'
-; ONE-NEXT: [0x000000006e][003]                  {Code} 'local.get	5'
-; ONE-NEXT: [0x0000000070][003]                  {Code} 'local.get	12'
-; ONE-NEXT: [0x0000000072][003]                  {Code} 'i32.store	28'
-; ONE-NEXT: [0x0000000075][003]      0           {Line} '{{.*}}/general/test.cpp'
-; ONE-NEXT: [0x0000000075][003]                  {Code} 'end'
-; ONE-NEXT: [0x0000000076][003]      9           {Line} {NewStatement} '{{.*}}/general/test.cpp'
-; ONE-NEXT: [0x0000000076][003]                  {Code} 'local.get	5'
-; ONE-NEXT: [0x0000000078][003]                  {Code} 'i32.load	28'
-; ONE-NEXT: [0x000000007b][003]                  {Code} 'local.set	13'
-; ONE-NEXT: [0x000000007d][003]                  {Code} 'local.get	13'
-; ONE-NEXT: [0x000000007f][003]                  {Code} 'return'
-; ONE-NEXT: [0x0000000080][003]                  {Code} 'end'
-; ONE-NEXT: [0x0000000081][003]      9           {Line} {NewStatement} {EndSequence} '{{.*}}/general/test.cpp'
-; ONE-NEXT: [0x0000000081][003]                  {Code} 'unreachable'
+; ONE-NEXT: [0x0000000047][003]                  {Code} 'local.get	9'
+; ONE-NEXT: [0x0000000049][003]                  {Code} 'i32.eqz'
+; ONE-NEXT: [0x000000004a][003]                  {Code} 'br_if   	0'
+; ONE-NEXT: [0x0000000065][003]      8           {Line} {NewStatement} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000065][003]                  {Code} 'local.get	5'
+; ONE-NEXT: [0x0000000067][003]                  {Code} 'i32.load	20'
+; ONE-NEXT: [0x000000006a][003]                  {Code} 'local.set	12'
+; ONE-NEXT: [0x000000006c][003]      8           {Line} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x000000006c][003]                  {Code} 'local.get	5'
+; ONE-NEXT: [0x000000006e][003]                  {Code} 'local.get	12'
+; ONE-NEXT: [0x0000000070][003]                  {Code} 'i32.store	28'
+; ONE-NEXT: [0x0000000073][003]      0           {Line} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000073][003]                  {Code} 'end'
+; ONE-NEXT: [0x0000000074][003]      9           {Line} {NewStatement} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x0000000074][003]                  {Code} 'local.get	5'
+; ONE-NEXT: [0x0000000076][003]                  {Code} 'i32.load	28'
+; ONE-NEXT: [0x0000000079][003]                  {Code} 'local.set	13'
+; ONE-NEXT: [0x000000007b][003]                  {Code} 'local.get	13'
+; ONE-NEXT: [0x000000007d][003]                  {Code} 'return'
+; ONE-NEXT: [0x000000007e][003]                  {Code} 'end'
+; ONE-NEXT: [0x000000007f][003]      9           {Line} {NewStatement} {EndSequence} '{{.*}}/general/test.cpp'
+; ONE-NEXT: [0x000000007f][003]                  {Code} 'unreachable'
 ; ONE-EMPTY:
 ; ONE-NEXT: -----------------------------
 ; ONE-NEXT: Element      Total    Printed
@@ -145,11 +145,11 @@
 ; ONE-NEXT: Total           85         85
 ; ONE-EMPTY:
 ; ONE-NEXT: Scope Sizes:
-; ONE-NEXT:        192 (100.00%) : [0x000000000b][001]              {CompileUnit} 'test.cpp'
-; ONE-NEXT:        113 ( 58.85%) : [0x000000002a][002]      2         {Function} extern not_inlined 'foo' -> [0x000000009c]'int'
-; ONE-NEXT:         27 ( 14.06%) : [0x0000000074][003]                  {Block}
+; ONE-NEXT:        180 (100.00%) : [0x000000000b][001]              {CompileUnit} 'test.cpp'
+; ONE-NEXT:        105 ( 58.33%) : [0x0000000026][002]      2         {Function} extern not_inlined 'foo' -> [0x0000000090]'int'
+; ONE-NEXT:         23 ( 12.78%) : [0x000000006c][003]                  {Block}
 ; ONE-EMPTY:
 ; ONE-NEXT: Totals by lexical level:
-; ONE-NEXT: [001]:        192 (100.00%)
-; ONE-NEXT: [002]:        113 ( 58.85%)
-; ONE-NEXT: [003]:         27 ( 14.06%)
+; ONE-NEXT: [001]:        180 (100.00%)
+; ONE-NEXT: [002]:        105 ( 58.33%)
+; ONE-NEXT: [003]:         23 ( 12.78%)
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wasm
index a4f21dd31de18f5c4236dedfe31961fda23d773a..0418d03148e3fbb144c0e7690c4a572bc09eba41 100644
GIT binary patch
delta 645
zcmcIfOKTHR6h8Ofxw$iGG4(AimI;;8_{dD2HDD<b1wnW1uE=EG<~382n}Vx}8$s+Q
z%&r^%fZJ^P7lbbCKX70C1EQWu75oEUINx{9x!-xcUz+D{gFPM+03aWy(<#snkfcMC
zWOjG`4iM%?M+M6oOWW;RhjBNO{)i>Bz1`Pj`CX<b`HMx_0nw5T^rldR_DYfHpp$-)
z>h#_s*@hz1sm_{oxqYcpFvWF6=PQeN6~i1B3RH>S?8hc)ryJx$@-u6>RQ7yl5?b9T
zh$CE8K|{>8#&K~*_!2aVc93xmfpE@{fbAkEFA=T)e}<HsXF$X$k}A}{Mal)xPiL4T
ztd|MS(SYNyZ|M%*+BZB~+Q#81?)k198-u~o at X;ua<)!y0Z at 2?H3iYbzG`G!KV7k at D
zwpVS{yrAA__*E|m9=nymX|@_}y<(c_7uvt}_1_x at -N=8MzF?ICr`cjRIm^@1bu~<n
z+3{6edW|R#@#6^-`vjb{q-@^*4%#ghv{ms7)O7%EP|%)>IniE;Q=;wxXdQ7zw7xh`
z-zsZ4wT^vH(i3GT=~P-}vuuW4sc-#{`%3URJFXz at QRqu6@NGF6`D6N^Fq}x+N#F1r
FzX7-ZnuY)X

delta 726
zcmcgo&ubGw6n-<a+ucp1Nn4sq#IT`IS~Qy<Zhk2u22_d`gbE%!q?64gS(@yI-A$yT
z`Ed~xFUwxUi~oRv7yTD{>DhBHJ$UfelP70F3;qQTyzf1}d2hZq-}l(t_;sNE0096B
zXR{fQ13=RQJedfbPQs1MRS6O1j1$eKA5iPCIdp9&U>=!-d-rbQD|0c0Vt+)!J(=)9
zyogQC%pePmWESb5qc`EV^__+w7YDLZ1G2I%>2gvKkiHMuCEl#)SXW+$zqU{#N}_ku
z_gn$uMw_)p-KOny+*f>Ai3flx_U00Ek at yLD;6(+{6ZIVqNY=;&2jmg2q<s#{AV1-0
z=~w_#PIyuk_1|IXH{j2wu*zQ`W6^cSLFU5eQ3h{!dO<MsZ|Cz}JLrvChHo>&cby}{
zatHbS-3Pg+o;{`k%Ui=yE^ytx)uXnP8xB2#Pw4d;EtE`?n&nP~)obla+bWeTTCG+)
zCat#0v|M8~&P1Q^;p$Ie&!q!>+hGr*4N_dw at a4MeGKt~hn))?*PCl$GBV`jMOn$jb
z6pFx&&dJu}Inq)pXlW%xsSH5!76xrkIY!zu<piZ(0BC*X6lpJ&GXx)n;EKoku4P;p
zFJv{8GPws|A|~CPdd0d?Fbd)`+yBRl9rz*kN(9vFvUt$!FdB?J=94HbUyI#P2W;Sa
HM-}rgKP0rD

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wat
index a79cd8749a5fb6..bbc1d8d0feb98e 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wat
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wat
@@ -1,20 +1,19 @@
 (module
   (type (;0;) (func (result i32)))
-  (type (;1;) (func (param i64 i64) (result i32)))
-  (type (;2;) (func (param i32 i64) (result i32)))
-  (import "env" "__linear_memory" (memory (;0;) i64 1))
-  (import "env" "__stack_pointer" (global (;0;) (mut i64)))
+  (type (;1;) (func (param i32 i32) (result i32)))
+  (import "env" "__linear_memory" (memory (;0;) 1))
+  (import "env" "__stack_pointer" (global (;0;) (mut i32)))
   (import "env" "_Z6printfPKcz" (func (;0;) (type 1)))
   (import "env" "__indirect_function_table" (table (;0;) 0 funcref))
   (func $__original_main (type 0) (result i32)
-    (local i64 i64 i64 i32 i64 i64 i32 i64 i64)
+    (local i32 i32 i32 i32 i32 i32 i32 i32 i32)
     global.get 0
     local.set 0
-    i64.const 16
+    i32.const 16
     local.set 1
     local.get 0
     local.get 1
-    i64.sub
+    i32.sub
     local.set 2
     local.get 2
     global.set 0
@@ -23,9 +22,9 @@
     local.get 2
     local.get 3
     i32.store offset=12
-    i64.const 0
+    i32.const 0
     local.set 4
-    i64.const 0
+    i32.const 0
     local.set 5
     local.get 4
     local.get 5
@@ -33,20 +32,20 @@
     drop
     i32.const 0
     local.set 6
-    i64.const 16
+    i32.const 16
     local.set 7
     local.get 2
     local.get 7
-    i64.add
+    i32.add
     local.set 8
     local.get 8
     global.set 0
     local.get 6
     return)
-  (func $main (type 2) (param i32 i64) (result i32)
+  (func $main (type 1) (param i32 i32) (result i32)
     (local i32)
     call $__original_main
     local.set 2
     local.get 2
     return)
-  (data $.L.str (i64.const 0) "Hello, World\0a\00"))
+  (data $.L.str (i32.const 0) "Hello, World\0a\00"))
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wasm
index da9355b3ad7dc71ce16f601bcc29b4f4ee7cba5b..2ff16db3d1c1753d5c3e15289deb1adf53858ac6 100644
GIT binary patch
delta 723
zcmcIiO=}ZT6n*!-nRebJZA6Org(N8TBP5xmO=1>)w5}Bu7ov+elldTaI#Xv}iVI;<
z!G&%#%t8>P;<_9A3&cfnqu`=oS6vl^BCfhAF1)X)(m&vXbMCq49cJd;d0(>6v#+X`
z31LpKm}|FVVRq))3t=}9PQ(&mPy78o0iwTOl64tiJUNY4pA_g!zQFP{&*nZnx(&$>
z8OW4v$Le|QZs3OB2_Xss86+1-C=0G92!>cj&{d>01kihu*~UMuZ0;G-R+TNORjCOX
zSw~Wp(ZA17ei9{F-bQl=0U4Rn=-|-q!7fYjD~5ZV4m4eMS((%)k**=G$oQC+p at WkR
zlvz4BI)ioW7Se^GF>xL1-g=FLA^QGtV-cm_=&?H$+Z1MHAqpQl9T8W2e{sGPg`pU#
zeZSK2&A`joY^%{Urd*>_t2gahYsz+~>vgAQyY9tK)wLR}dS|+780k&+?(nmN!}Ys?
z(@UvR9#^Rx0n<Uv==4lFt0XX*eo`jy{v!N{Lilm^n`oy9;b++@@FH6S-eeoVXW1t3
z8*B^seYOsog^7 at D1CQAb@Fifoz+d98r~ECj7gSpT@{wqtfqYG`swYOYD!%khYO0r#
z2h~>DC>vf^<j?(&!=EQB@~-8C8F`LqyN)S(krUHmZoVf>Yr=O*o*!DK9~ZT_>jfp}
GvG at ZV(5h+x

delta 783
zcmcgq&ubGw6rMM;Yck1}YAK7<A_+pN)@*)|pY>1?DtOcO?y}j;ri;n$ve{IE*iF1h
zK#E}nMFcJALGYj;{sGdf;K4&rUMm!Zp6aF0nP5x*0w28Zeec_EXWu?%sC-kN=C4bL
zFlT*I*E at k>-qStTb^_*;4Iq#D{XPPecsmev3ozM8hL^b5M`?T`l_n{iA`d^gD-iw_
zmZa8T^=?zQ9n1ZN5R!Nz6bFH6G!TWyCQmYE2yO9-w>j+a1bkN@**oFV{#X#QEFB0g
z3y#p4T at JDoJ3c2A2T8w?^!kvK82=(9g)@#vXO+{PGJVofJc`eXP7%(;6%NZhMJ(}z
ziFgu^W*0eC at aVjFG_lG-gz$24`p&rH0PmxZc-~qI0<W`}%{J{|ty|YRHq$z;)6-11
zon5`PoVo4W>qfw`rq|5`uG=!#4BN?gp0DvYQnjj)D-?@Hv1FB5t=cFz%tFC5DwT>=
zG%EFyQL3^kSE8%r&D8Mp!dte(deKj!O;LQj5|RKpnZR?=j1&TmUP^P}0H`V<Izu)=
zy@(K9AlpE*WC!RqvIq1g*$28p4uI-p7gUQo?vq2H56ELohd`cS`W(nJOy2={h1Ji1
zz9RJppzjF15O?C7&swgj{ksHWrWmMszMT(ZR_aAdawYWhH7%#*#Q)C!pLJbEU&M5i
ef#Ek<GSDq%1YMtXNc2a(kXVSfS=;q{<>C?Pl(td;

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wat
index 4461a5844667c9..e858b5e1cd21ac 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wat
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wat
@@ -1,16 +1,16 @@
 (module
   (type (;0;) (func (param i32 i32) (result i32)))
-  (import "env" "__linear_memory" (memory (;0;) i64 0))
-  (import "env" "__stack_pointer" (global (;0;) (mut i64)))
+  (import "env" "__linear_memory" (memory (;0;) 0))
+  (import "env" "__stack_pointer" (global (;0;) (mut i32)))
   (func $_Z4testii (type 0) (param i32 i32) (result i32)
-    (local i64 i64 i64 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
+    (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
     global.get 0
     local.set 2
-    i64.const 32
+    i32.const 32
     local.set 3
     local.get 2
     local.get 3
-    i64.sub
+    i32.sub
     local.set 4
     local.get 4
     local.get 0
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wasm
index ef8d5f69ee9980623dbb98192c58f5fd9676da44..8833634ab4b48f943a44fa8fb26e867d1f7efc75 100644
GIT binary patch
delta 841
zcmcIgO-NKx6u#&Fym{BOu at EIKcqWu0&YzAZ5mLJd7eSk7G0nVrZ+QBAPiCIxBALk`
zP$-(-B9Nj*5G`tBAgwf96iErW)RmjWg#<?A!bRtfE?Tth!uh^)zH{!q=bVk>zZ)K>
zuMom4Z!((6l!B}|ni=;UFR+TN4D5cTQX!N;-SUib9LCCQS}S*;Tp{gnxv`xZV9?R(
zo$IaZz#7VQTK*&Z{iVdx7K0frBjFQxSl+sa_m9Q$R&Jt at aXj1qMhM|(h at h~Y_=@n{
zJ)|1a1th^4MRL&iE at 3Yg(OE(RIHx39t>3Ig9}x)~Ls&<vm9C((iiVRdD~(p8+sMGa
zA_`j7_f#ZaBWmi|YlkvFP_lf7NFwT!eHHVF`hjA*5FvC;<v86!;+*axX_$GX_SA4R
zXEEy)tdi=zc@#l)HdGrH9d*L+7VEqb&u4>de7xw7SY}X)yYA#zPto^-L+?nBn=U?P
zr1H7`fkdyJFjMJ)d}^>aZ}+9sRw{4X7tExc>mN*;eaS>3++oj7&i}o0*YT{m at F|Zm
zL23AfpQ;yBHPj at cb+jw|#b+BQATkF)egcUs;*_)DBhlgfAhKB_vQ-=qd6pA-UMzqf
zBSc;liy()@63Ah(3HnV+q%BrJj)+x|Q(_zB0}y+lSAl*e@;QhDkZ(ckgM1HShRP2h
z)<Av&u?2Ds#BSK8ojIXnM>;1vMAs?N>*;!URcou$lc)~k9_K?(yJX%@4#pC(M8OG+
n&i}EzF7hTcB2A}hcXVtb$mU$Dr{MaztXt~VOHRS-v8IAQMdQVp

delta 1001
zcmcgqO-vI(6rMLbv+We2pkyJMm^K(iNw=kGX)%!l#Q1lS7!RJBrEJRv+HJO542g7$
za*@QwvK}!e8WR&W-i(sy1rA({90(=`4SMsyK{*gkI0MvZ^z2LC_x`?}ee>RIHGXWm
z8}BDb((~i~RH|re>CsfdH1f7?NoA03RVo#P5%?Bv3dfM7vNS0>9Xwq at LFjJ|;s6Bj
zWbOLk(N&;Q+2`O%kAus9Grm4zoZc3Y0&O?kD%^3tPw_Jv)M0(7lua4=jQIs2M7Sd4
z1%W{{B at CD9p817%k-L;gct2xsOE!@7V2L}+Tmepr6s{fE*o{^>A}J at 3i-?FL_$%C7
z;|kJyk;66r_HOivBgHi@;f(-&#Upv1gOE#Hd5JWM5?c@{kNBBS#Ka at cZWXQv;dN0X
zc#|7K at D4XJue=qrYgGI8E^cZ0tX`~NWR!D+)H at yE{C~=0H!O8#Mr^xKJRJ^a4SS?C
zq!tZbEt>fWHErg?S1z0lUAByI&DO)|LMddM=2&_}GxDKA!BY7bf!?GRiN<1DES~An
zdy~UG!|7-=ttAqPOiW7*#kF`+Px6fWRGK^Z at b_(v8F_uyy++gs!}ZpI9`kvB$T->(
zd>y3i7ct>mKn&Nf(n|e49CBZf+szZ;sq)$uAkRDoG~=G99nKUmMMmr}tpYnv5bL6g
zphOX319S=4Il2t&D%}7@!-!dQ1=u)U12zqG8`vz+X{_7_{0_0_K&zO&0Xl=(63}~?
zEdyN#_5tW7u+Knu06h^aIArN#W?J2UfPH(5kcq<Qt$5Klq%>oswBuDkbAsOT2VG3S
zi<NH99pn>u=AMwxI97MB8c`!+ww?cHH7C(a(VO4atgPN(r!u-`mn^*~xoh$fUzazh
K=S*v&C-xIO;N`gh

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wat
index 6b65ca23ab6d64..90ea3456b055d8 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wat
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wat
@@ -1,17 +1,17 @@
 (module
   (type (;0;) (func (param f32) (result i32)))
   (type (;1;) (func (param i32) (result i32)))
-  (import "env" "__linear_memory" (memory (;0;) i64 0))
-  (import "env" "__stack_pointer" (global (;0;) (mut i64)))
+  (import "env" "__linear_memory" (memory (;0;) 0))
+  (import "env" "__stack_pointer" (global (;0;) (mut i32)))
   (func $_Z3barf (type 0) (param f32) (result i32)
-    (local i64 i64 i64 f32 f32 f32 i32 i32 i32 i32 i32 i32)
+    (local i32 i32 i32 f32 f32 f32 i32 i32 i32 i32 i32 i32)
     global.get 0
     local.set 1
-    i64.const 16
+    i32.const 16
     local.set 2
     local.get 1
     local.get 2
-    i64.sub
+    i32.sub
     local.set 3
     local.get 3
     local.get 0
@@ -52,14 +52,14 @@
     local.get 12
     return)
   (func $_Z3fooc (type 1) (param i32) (result i32)
-    (local i64 i64 i64 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 f32 f32 i32 i32 i32 i32 i32 i32 i32 i64 i64)
+    (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 f32 f32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
     global.get 0
     local.set 1
-    i64.const 16
+    i32.const 16
     local.set 2
     local.get 1
     local.get 2
-    i64.sub
+    i32.sub
     local.set 3
     local.get 3
     global.set 0
@@ -137,11 +137,11 @@
     local.get 21
     i32.add
     local.set 22
-    i64.const 16
+    i32.const 16
     local.set 23
     local.get 3
     local.get 23
-    i64.add
+    i32.add
     local.set 24
     local.get 24
     global.set 0
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wasm
index f20d68bca653baa359bb0067c05d790a338961f7..c3465cfe8f16fc7b2b5072c1c41b53ab4cdf8335 100644
GIT binary patch
delta 522
zcmcIfyGjE=6uozMMt2AzidZO!V&NksyLlM{T3FeLAPAPakJ)8)%}RD63PNIOAsV(5
z!OG4;f~2yuO_N^19}s`Q!dV~S4>)ihbM766bIo3~OC6zQjAEm;n#Pq at blx~SZ8jm5
zb+}dcw*9Ib9s>Z8kc<gWL70d<ClZQ8D$%y2vIJ^Wl>#b#Om2weLF!uKDNx$^3Ki)4
zec1o at wSMy?2VH<6KvtKwzbA>xe_!KkoZZwNQ<(ZeE!^d{i1Z*h+|Sg)P<*?eT(<+W
z>P_YyYoTluT*J<n%1*vgaNJ_4#Pg2pF4{TQTBwxlV$Lw)dBq>@HviNO{3>6HZ<U-%
z6&k-N8~7aS>h#h(uu%$ZjC_DL0l;QR8)*T7RmdZ<74m>=opey!0vNDV=8-34d!&o(
zko4jUb-Yh2f(lphy}I1k$yKsO*6 at 5WIr|^2=HM==G$_oP$HlhGO;NA$NJ$Uw*M(_~
U1U%yfp=Ab9T8n(In&C&{6SEG2(EtDd

delta 585
zcmcgo&ui2`6n-z6bTiaa at sNX}C|)WdKe}W$yF&2?i1el?UYALBk_}{&C7Gzb*j+(9
zwR8#I1pfigUc8plQ}NPcd+FJWe}OZ_L;nH?zVCf}%*^}VJ2Su10}sj4xA4RAxs6Yk
z_1^B6#e5E{?wChSI?9Tq`~(0*0>DJY_h6xlJo^&br2<%0`cTp%2{ftx&j;N&Q4S(G
zlJ&LH1{lWirK!Qn)ekzq_1n^iZ>N&Z)eWk8buJ_sGQ*$t05_6}5VQKB=cSpLG?80p
z+^x%E$BoOW_iFo@^P<Y$GQqug);OXp^LWCt!kNt~SH8GA95BBd1T5$!eLftF`{TIV
zjae9mNx;IW$9e-kkWPC|%WnLdUs*<;75s7gS=;PT&5((p{i(ggvvy6tzqLSW89;B6
zeYEZXP at 5d$^$>wRAty+;$q~{w<QT0Hz*?cxnw%niN6wLcL~_yQ`mGf!03E)!d-~RH
zwK;Ts*H>vb{?D)v;D?%YU9c+Uz8EE(iKgPUZm&-p!J?cyX<kMwuWhr=(!$~Ig>6px
Jw5)de!CyrulNbO1

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wat
index 4c1f2857c636e7..b9421ad40cb83b 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wat
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wat
@@ -1,11 +1,11 @@
 (module
   (type (;0;) (func (result i32)))
-  (import "env" "__linear_memory" (memory (;0;) i64 1))
-  (import "env" "__stack_pointer" (global (;0;) (mut i64)))
+  (import "env" "__linear_memory" (memory (;0;) 1))
+  (import "env" "__stack_pointer" (global (;0;) (mut i32)))
   (func $_Z4testv (type 0) (result i32)
     (local i32)
     i32.const 1
     local.set 0
     local.get 0
     return)
-  (data $S (i64.const 0) "\00"))
+  (data $S (i32.const 0) "\00"))
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wasm
index 2147ec7fa041097909833b74370f7db4581724e1..b3c9b2eb4a897b519d580037f823e3c8db3c4666 100644
GIT binary patch
delta 795
zcmcIh&ubG=5T1E&H_2-PRTCtL$c7$_mi%mzHr{&a$zu=R(#`$|X_IW(Y>GXUjiRVG
z!y*<D#9qAAdZ?!&1q)uRr{EvZqn9A)p&kl4FKPb-AIyB;H$3KjZ)QLGYsv?`+eQGu
zr~Q5(aE1H6k3Rb#72{TCW4cyrH9MB>*4kFvaW@&jdAaN9##(LNX?8rz<v#L<;}$UW
zcZ^#Y^=F9nA;lN9l%jD>Sxc#!szHS%39!Nvmo%0N5f9ygxTa<xJ{V|;*kU*prDC+g
zuE&sAnk5EbcKmM-s97{?TJ>I|*6i5MCo-;3P?mpy6gU#-+@~O?uqE+=C?inc>`~=_
z0 at -uQoDGskWA$>P62r0Dov8R|toA7 at cb6$ADO5Iyoyoc?`#?zcQR#hDAbcpf651g+
zra+9mBM|aR_(Ucpd`iGjJR$(t4whJYIcMsgo?CaFRm<?YxmIhVopBw<o3QhG&S>eK
zhE_D|mHGUfoi~c*d9zrZGwo8jY!yx0UN8!Fy;3b3r9wU*d}nX3{E*|nn3!DSz2FJI
z9aG06iL2o$mJ2 at fRV9S*JIE<B{!b8B6%g0>ABfxlh}<OeCBBDZfghk);zuZ!`4B~&
zk1*1PuOK%08H#7fA2TsPeu&~V@?#Y5k)NRWi2M{`Te`UHS}n)Oo^MZj31cKfBX}jZ
zD(I7D&j^M}(O)T4v-xbk(e$+R|Cr1z*p-H+J>6|sUd^_2ujg7_Hap$!d3rr~p(g$T
DJ4eAr

delta 901
zcmcgr&ubGw6rMLT`7uqfwMrBb+0aWhWRuo3Ns9*+Ja{RB*FrkkOwz4McG;aR_Fy*=
zgxZ4|g6P2_=tZRHp&)v)Ac%(wJ at nwEH;;NL-s?<S#lOIT_rCYNoqhY}d$apPn~4x{
zzXb>(SnYH=2<FL37($5OYKDnuFAY~JO}j0)S80is<1J%~j?%v5)~$-`*lj61vI6Ap
zpadG~c6F%`la+Wlrg9yWCRdF#HHbm)q$5VeKqWGw0E(kHY2b8J#nBm*Fd|u$=sh$}
z(krpFVn(8f&n7`d<2c#-^dkJGD<{mFs0NLS-L5-dRO?h3LUDZxltx_*YON{5g9xEe
z$Nv)g6GfhHsqD5gz|WK?xHqypU at s3@^80|jKV*pmh4X+vDxkB<>2+FJ1o!AM^=*iJ
z)~TqjbxL!JVmtadjlNN^rwkyzsetJ%v3>1mjH#^{*dxUddfhMM at o+&(*PqGd8n#>r
zs-|xX(|6j-rscG9H?LpI-tg=tE=A6AgRFF%rnSKBcGh)0Q at vqKmwA4&P~e5BdQnW5
zYsH#1Icf1ysZ=lUQgw<?l|@-)&Lb&&X<Dv}ay2e_&h?x{VM)LL6|au|&{O*(w4VQ5
zzd<gHu)ivvh{T5QM1P$uQl<Q_eu9pLU0^AS*cq}0sdEUWGU}|C$QH26WE<El*#$O7
zz5`n%2apPs_Us;z2betu@&vPWAUnWb0oeog0mweEEg<(Xda7GF?un*jnMae?4aFdp
zRg!J!8^KiXwV=O2FNWU4w3#>aT8Z)hCFDEZ;jrXhL*!+pF1QRl;gig8E0Da}6xl}8
Xsq&_uiTie=ofWrbCVu!c6$`%s#CqNk

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wat
index ccacc0fab12918..57640b699dc4a0 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wat
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wat
@@ -1,30 +1,30 @@
 (module
-  (type (;0;) (func (param i64 i32 i32) (result i32)))
-  (import "env" "__linear_memory" (memory (;0;) i64 0))
-  (import "env" "__stack_pointer" (global (;0;) (mut i64)))
-  (func $_Z3fooPKijb (type 0) (param i64 i32 i32) (result i32)
-    (local i64 i64 i64 i32 i32 i32 i32 i32 i32 i32 i32)
+  (type (;0;) (func (param i32 i32 i32) (result i32)))
+  (import "env" "__linear_memory" (memory (;0;) 0))
+  (import "env" "__stack_pointer" (global (;0;) (mut i32)))
+  (func $_Z3fooPKijb (type 0) (param i32 i32 i32) (result i32)
+    (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
     global.get 0
     local.set 3
-    i64.const 32
+    i32.const 32
     local.set 4
     local.get 3
     local.get 4
-    i64.sub
+    i32.sub
     local.set 5
     local.get 5
     local.get 0
-    i64.store offset=16
+    i32.store offset=24
     local.get 5
     local.get 1
-    i32.store offset=12
+    i32.store offset=20
     local.get 2
     local.set 6
     local.get 5
     local.get 6
-    i32.store8 offset=11
+    i32.store8 offset=19
     local.get 5
-    i32.load8_u offset=11
+    i32.load8_u offset=19
     local.set 7
     i32.const 1
     local.set 8
@@ -41,7 +41,7 @@
         local.set 10
         local.get 5
         local.get 10
-        i32.store offset=4
+        i32.store offset=12
         i32.const 7
         local.set 11
         local.get 5
@@ -50,7 +50,7 @@
         br 1 (;@1;)
       end
       local.get 5
-      i32.load offset=12
+      i32.load offset=20
       local.set 12
       local.get 5
       local.get 12
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt
index 9e6c8dc6aa845d..0511c4b7e805b3 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt
@@ -49,6 +49,6 @@ For target=wasm32
 
 Notes:
 ------
-* The tests run the .wasm file (target=wasm64).
+* The tests run the .wasm file (target=wasm32).
 * The .wat files were generated using WABT wasm2wat tool and are included
   only for extra information.

>From 2187be7ec7ca8154620ce817460f73609130a752 Mon Sep 17 00:00:00 2001
From: Carlos Alberto Enciso <carlos.alberto.enciso at gmail.com>
Date: Tue, 27 Feb 2024 12:01:59 +0000
Subject: [PATCH 4/7] [llvm-debuginfo-analyzer] Add support for WebAssembly
 binary format.

Add support for the WebAssembly binary format and be able to
generate logical views.

https://github.com/llvm/llvm-project/issues/69181

- Remove the binary files (.wasm) and associated (.wat) used in
  the tests and replaced them with their YAML versions.
- Remove the README as now it is irrelevant.
---
 .../01-wasm-compare-logical-elements.test     |   8 +-
 .../01-wasm-print-basic-details.test          |   6 +-
 .../01-wasm-select-logical-elements.test      |   6 +-
 .../WebAssembly/02-wasm-logical-lines.test    |   4 +-
 ...-wasm-incorrect-lexical-scope-typedef.test |   6 +-
 .../04-wasm-missing-nested-enumerators.test   |   8 +-
 ...wasm-incorrect-lexical-scope-variable.test |   6 +-
 .../06-wasm-full-logical-view.test            |   4 +-
 .../WebAssembly/Inputs/hello-world-clang.wasm | Bin 1333 -> 0 bytes
 .../WebAssembly/Inputs/hello-world-clang.wat  |  51 ----
 .../WebAssembly/Inputs/hello-world-clang.yaml | 210 +++++++++++++++
 .../WebAssembly/Inputs/pr-43860-clang.wasm    | Bin 1545 -> 0 bytes
 .../WebAssembly/Inputs/pr-43860-clang.wat     |  75 ------
 .../WebAssembly/Inputs/pr-43860-clang.yaml    | 171 +++++++++++++
 .../WebAssembly/Inputs/pr-44884-clang.wasm    | Bin 1783 -> 0 bytes
 .../WebAssembly/Inputs/pr-44884-clang.wat     | 149 -----------
 .../WebAssembly/Inputs/pr-44884-clang.yaml    | 241 ++++++++++++++++++
 .../WebAssembly/Inputs/pr-46466-clang.wasm    | Bin 1117 -> 0 bytes
 .../WebAssembly/Inputs/pr-46466-clang.wat     |  11 -
 .../WebAssembly/Inputs/pr-46466-clang.yaml    | 169 ++++++++++++
 .../WebAssembly/Inputs/test-clang.wasm        | Bin 1394 -> 0 bytes
 .../WebAssembly/Inputs/test-clang.wat         |  63 -----
 .../WebAssembly/Inputs/test-clang.yaml        | 168 ++++++++++++
 .../WebAssembly/README.txt                    |  54 ----
 24 files changed, 991 insertions(+), 419 deletions(-)
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wasm
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wat
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.yaml
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wasm
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wat
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.yaml
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wasm
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wat
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.yaml
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wasm
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wat
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.yaml
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wasm
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wat
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.yaml
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test
index 4194fd89dd5dfe..7461fa6f26372c 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test
@@ -17,11 +17,13 @@
 ; The output shows in view form the 'missing (-), added (+)' elements,
 ; giving more context by swapping the reference and target object files.
 
+; RUN: yaml2obj %p/Inputs/test-clang.yaml -o test-clang.wasm
+
 ; RUN: llvm-debuginfo-analyzer --attribute=level \
 ; RUN:                         --compare=types \
 ; RUN:                         --report=view \
 ; RUN:                         --print=symbols,types \
-; RUN:                         %p/Inputs/test-clang.wasm \
+; RUN:                         test-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
@@ -50,7 +52,7 @@
 ; RUN:                         --compare=types \
 ; RUN:                         --report=list \
 ; RUN:                         --print=symbols,types,summary \
-; RUN:                         %p/Inputs/test-clang.wasm \
+; RUN:                         test-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s
 
@@ -80,7 +82,7 @@
 ; RUN:                         --report=list \
 ; RUN:                         --print=symbols,types,summary \
 ; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o \
-; RUN:                         %p/Inputs/test-clang.wasm 2>&1 | \
+; RUN:                         test-clang.wasm 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=THR %s
 
 ; THR:      Reference: 'test-dwarf-gcc.o'
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
index ddb9c34fca130c..112083231b1340 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
@@ -18,16 +18,18 @@
 ; sorted by the debug information internal offset; it includes its lexical
 ; level and debug info format.
 
+; RUN: yaml2obj %p/Inputs/test-clang.yaml -o test-clang.wasm
+
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format \
 ; RUN:                         --output-sort=offset \
 ; RUN:                         --print=scopes,symbols,types,lines,instructions \
-; RUN:                         %p/Inputs/test-clang.wasm 2>&1 | \
+; RUN:                         test-clang.wasm 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format \
 ; RUN:                         --output-sort=offset \
 ; RUN:                         --print=elements \
-; RUN:                         %p/Inputs/test-clang.wasm 2>&1 | \
+; RUN:                         test-clang.wasm 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
 ; ONE:      Logical View:
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
index 3a2443152236d8..516924e36b9977 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
@@ -18,12 +18,14 @@
 ; contain 'BLOCK' or '.store' in their names or types, using a tab layout
 ; and given the number of matches.
 
+# RUN: yaml2obj %p/Inputs/test-clang.yaml -o test-clang.wasm
+
 ; RUN: llvm-debuginfo-analyzer --attribute=level \
 ; RUN:                         --select-nocase --select-regex \
 ; RUN:                         --select=BLOCK --select=.store \
 ; RUN:                         --report=list \
 ; RUN:                         --print=symbols,types,instructions,summary \
-; RUN:                         %p/Inputs/test-clang.wasm 2>&1 | \
+; RUN:                         test-clang.wasm 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
 ; ONE:      Logical View:
@@ -54,7 +56,7 @@
 ; RUN:                         --select=INTe \
 ; RUN:                         --report=list \
 ; RUN:                         --print=symbols,types \
-; RUN:                         %p/Inputs/test-clang.wasm \
+; RUN:                         test-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s
 
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
index 2c77c8b037d0ff..e9aeb7b444f35b 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
@@ -15,9 +15,11 @@
 ; The logical views shows the intermixed lines and assembler instructions,
 ; allowing to compare the code generated by the different toolchains.
 
+; RUN: yaml2obj %p/Inputs/hello-world-clang.yaml -o hello-world-clang.wasm
+
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
 ; RUN:                         --print=lines,instructions \
-; RUN:                         %p/Inputs/hello-world-clang.wasm 2>&1 | \
+; RUN:                         hello-world-clang.wasm 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
 ; ONE:      Logical View:
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test
index 8902a5168834ab..ced55618d04e43 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test
@@ -30,10 +30,12 @@
 ; emits both typedefs at the same lexical scope (3), which is wrong.
 ; GCC emit correct lexical scope for both typedefs.
 
+; RUN: yaml2obj %p/Inputs/pr-44884-clang.yaml -o pr-44884-clang.wasm
+
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
 ; RUN:                         --output-sort=kind \
 ; RUN:                         --print=symbols,types,lines \
-; RUN:                         %p/Inputs/pr-44884-clang.wasm \
+; RUN:                         pr-44884-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/pr-44884-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
@@ -113,7 +115,7 @@
 ; RUN:                         --select-types=Typedef \
 ; RUN:                         --report=list \
 ; RUN:                         --print=types \
-; RUN:                         %p/Inputs/pr-44884-clang.wasm \
+; RUN:                         pr-44884-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/pr-44884-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s
 
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test
index cdcb7d45460331..6e13f25aa582c1 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test
@@ -25,10 +25,12 @@
 ; references to the enumerators 'RED' and 'BLUE'. The DWARF generated
 ; by GCC, does include such references.
 
+; RUN: yaml2obj %p/Inputs/pr-46466-clang.yaml -o pr-46466-clang.wasm
+
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
 ; RUN:                         --output-sort=name \
 ; RUN:                         --print=symbols,types \
-; RUN:                         %p/Inputs/pr-46466-clang.wasm \
+; RUN:                         pr-46466-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/pr-46466-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
@@ -63,7 +65,7 @@
 ; RUN:                         --select-types=Enumerator \
 ; RUN:                         --report=parents \
 ; RUN:                         --print=types \
-; RUN:                         %p/Inputs/pr-46466-clang.wasm \
+; RUN:                         pr-46466-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/pr-46466-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s
 
@@ -90,7 +92,7 @@
 ; RUN:                         --output-sort=name \
 ; RUN:                         --select-types=Enumerator \
 ; RUN:                         --print=types,summary \
-; RUN:                         %p/Inputs/pr-46466-clang.wasm \
+; RUN:                         pr-46466-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/pr-46466-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=THR %s
 
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test
index fac3bacffcc405..f1214d9b6d23ee 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test
@@ -31,10 +31,12 @@
 ; The DWARF generated by GCC/Clang show those variables at the correct
 ; lexical scope: '3' and '4' respectively.
 
+; RUN: yaml2obj %p/Inputs/pr-43860-clang.yaml -o pr-43860-clang.wasm
+
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
 ; RUN:                         --output-sort=name \
 ; RUN:                         --print=symbols \
-; RUN:                         %p/Inputs/pr-43860-clang.wasm \
+; RUN:                         pr-43860-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/pr-43860-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
@@ -88,7 +90,7 @@
 ; RUN:                         --select=Var \
 ; RUN:                         --report=list \
 ; RUN:                         --print=symbols \
-; RUN:                         %p/Inputs/pr-43860-clang.wasm \
+; RUN:                         pr-43860-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/pr-43860-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s
 
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
index 21978a93afd5cf..ddb93a71145f16 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
@@ -18,9 +18,11 @@
 ; offsets within the debug information section, debug location
 ; operands, linkage names, etc.
 
+; RUN: yaml2obj %p/Inputs/test-clang.yaml -o test-clang.wasm
+
 ; RUN: llvm-debuginfo-analyzer --attribute=all \
 ; RUN:                         --print=all \
-; RUN:                         %p/Inputs/test-clang.wasm 2>&1 | \
+; RUN:                         test-clang.wasm 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
 ; ONE:      Logical View:
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wasm
deleted file mode 100644
index 0418d03148e3fbb144c0e7690c4a572bc09eba41..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 1333
zcmcIkOOM-B6h8O*9cP?OBcSa_$WdFMYU5;PGBXUIme7vWQ7g4-E1|ZFJAT}_o^fpJ
z+6iqp8N`wuVu9Ge4`AC(e*g;>UC at 7k#IizNBLU|+L8|B)OFrk^&*$ZHJ{$aULI8k#
zeSCZj^Z>~GfX?S+PJfqxs_<;qVk}KE?h7{IlUzKeK$dV>`QZ^O at +7OcQ06tf!tQSu
z0+I2p>*14y>nX;PEJ_3qD>j~HVU^?=tNbA4qySL9s%ryjekl#ocv+tx5Nm!0tz+oI
zsNE$lxa6oyU3#_#N6=MV>MGl`Ia+wB2x+eBYVG=b8jm^#8t7#lc1_n at 1iE_5ZV@tX
z*VSagmTiA4>kt@$?Ofw&nqPE3&qW$F0A9%_D_+EdY0Uf}5PU{f$vLN^DNg&HHD{Ha
z&;jTW_B$WhAKUaKz7Qe%9RRh9*p3aLy at v*Xeijtxl5HbmNYl12p=o*`Q+#?-ab)~{
z=kh7s2mB?=+RL&@HqJ8yRrv%|xiB0`E)`yLyeZxfq~1h9G)+MT%4HPlbrcS0S5fIt
zr69&LRHkA68>GGj`onX?h;k?$UZBvh)^9i=Xe at guD-ouC7P~VpO5C5jzUvLVL7Y_X
z2mQ#e{C*+wL)>uLPt)0?C-S^nSWCRW2;Yc;?VZ8qco1%E?L-^9o6&f<wZ%80@%Y1V
zeH?7>ZiU13!QebRl#A$nA@|^gMFIb*QidWau$thp;H7M-S5A|P_mixcR{fY~T=*%3
z4}AfQjc(r_-D7w5 at 9(j at _ipVm1`|KY0C@`V>+7?YRR0VIpu+odB82?utVmUVB?!FH
z7JA{hs2t{7n$n=>J7!GRFa&BI8<_AY$zp2$EX!E9KK!6^k;F;nr%ZN1+d!!9-SBY6
za#wAvPSv_UmDsHIVY57m6sjxKRH&tWBXbeQ6S*9{w~Qt5qr at A6r+MgIxp{R@)eYSD
z8c{D|f1fDET>=5XFVbsu;q at BDjHadQU^NY}P8ffH^|lGtY2$A&-^CZ~Q?T}or^LEp
zJR{~E0PDbbPOKy21%dD0%qPca5p#%B`Cih<LKZ~R5V=E5Nu#MBbK+cKMLI1PVtoir
zbP92oJn99HiB=Ql;D6`YPqO<~<%^i(?}_`>6!}Civ?kN~7uAc?Jn+-<f>|bU*5i+=
Fe*h)3O+o+w

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wat
deleted file mode 100644
index bbc1d8d0feb98e..00000000000000
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.wat
+++ /dev/null
@@ -1,51 +0,0 @@
-(module
-  (type (;0;) (func (result i32)))
-  (type (;1;) (func (param i32 i32) (result i32)))
-  (import "env" "__linear_memory" (memory (;0;) 1))
-  (import "env" "__stack_pointer" (global (;0;) (mut i32)))
-  (import "env" "_Z6printfPKcz" (func (;0;) (type 1)))
-  (import "env" "__indirect_function_table" (table (;0;) 0 funcref))
-  (func $__original_main (type 0) (result i32)
-    (local i32 i32 i32 i32 i32 i32 i32 i32 i32)
-    global.get 0
-    local.set 0
-    i32.const 16
-    local.set 1
-    local.get 0
-    local.get 1
-    i32.sub
-    local.set 2
-    local.get 2
-    global.set 0
-    i32.const 0
-    local.set 3
-    local.get 2
-    local.get 3
-    i32.store offset=12
-    i32.const 0
-    local.set 4
-    i32.const 0
-    local.set 5
-    local.get 4
-    local.get 5
-    call 0
-    drop
-    i32.const 0
-    local.set 6
-    i32.const 16
-    local.set 7
-    local.get 2
-    local.get 7
-    i32.add
-    local.set 8
-    local.get 8
-    global.set 0
-    local.get 6
-    return)
-  (func $main (type 1) (param i32 i32) (result i32)
-    (local i32)
-    call $__original_main
-    local.set 2
-    local.get 2
-    return)
-  (data $.L.str (i32.const 0) "Hello, World\0a\00"))
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.yaml b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.yaml
new file mode 100644
index 00000000000000..6cba3c0ddb9a59
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.yaml
@@ -0,0 +1,210 @@
+--- !WASM
+FileHeader:
+  Version:         0x1
+Sections:
+  - Type:            TYPE
+    Signatures:
+      - Index:           0
+        ParamTypes:      []
+        ReturnTypes:
+          - I32
+      - Index:           1
+        ParamTypes:
+          - I32
+          - I32
+        ReturnTypes:
+          - I32
+  - Type:            IMPORT
+    Imports:
+      - Module:          env
+        Field:           __linear_memory
+        Kind:            MEMORY
+        Memory:
+          Minimum:         0x1
+      - Module:          env
+        Field:           __stack_pointer
+        Kind:            GLOBAL
+        GlobalType:      I32
+        GlobalMutable:   true
+      - Module:          env
+        Field:           _Z6printfPKcz
+        Kind:            FUNCTION
+        SigIndex:        1
+      - Module:          env
+        Field:           __indirect_function_table
+        Kind:            TABLE
+        Table:
+          Index:           0
+          ElemType:        FUNCREF
+          Limits:
+            Minimum:         0x0
+  - Type:            FUNCTION
+    FunctionTypes:   [ 0, 1 ]
+  - Type:            DATACOUNT
+    Count:           1
+  - Type:            CODE
+    Relocations:
+      - Type:            R_WASM_GLOBAL_INDEX_LEB
+        Index:           1
+        Offset:          0x6
+      - Type:            R_WASM_GLOBAL_INDEX_LEB
+        Index:           1
+        Offset:          0x1B
+      - Type:            R_WASM_MEMORY_ADDR_SLEB
+        Index:           2
+        Offset:          0x2C
+      - Type:            R_WASM_FUNCTION_INDEX_LEB
+        Index:           3
+        Offset:          0x3C
+      - Type:            R_WASM_GLOBAL_INDEX_LEB
+        Index:           1
+        Offset:          0x54
+      - Type:            R_WASM_FUNCTION_INDEX_LEB
+        Index:           0
+        Offset:          0x62
+    Functions:
+      - Index:           1
+        Locals:
+          - Type:            I32
+            Count:           9
+        Body:            238080808000210041102101200020016B21022002248080808000410021032002200336020C418080808000210441002105200420051080808080001A4100210641102107200220076A2108200824808080800020060F0B
+      - Index:           2
+        Locals:
+          - Type:            I32
+            Count:           1
+        Body:            108180808000210220020F0B
+  - Type:            DATA
+    Segments:
+      - SectionOffset:   6
+        InitFlags:       0
+        Offset:
+          Opcode:          I32_CONST
+          Value:           0
+        Content:         48656C6C6F2C20576F726C640A00
+  - Type:            CUSTOM
+    Name:            .debug_abbrev
+    Payload:         011101250E1305030E10171B0E11011206000002340049133A0B3B0B02180000030101491300000421004913370B000005260049130000062400030E3E0B0B0B0000072400030E0B0B3E0B0000082E00110112064018030E3A0B3B0B49133F19000000
+  - Type:            CUSTOM
+    Relocations:
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           6
+        Offset:          0x6
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           7
+        Offset:          0xC
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           7
+        Offset:          0x12
+        Addend:          111
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           8
+        Offset:          0x16
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           7
+        Offset:          0x1A
+        Addend:          127
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x1E
+      - Type:            R_WASM_MEMORY_ADDR_I32
+        Index:           2
+        Offset:          0x2F
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           7
+        Offset:          0x45
+        Addend:          181
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           7
+        Offset:          0x4C
+        Addend:          186
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x53
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           7
+        Offset:          0x60
+        Addend:          206
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           7
+        Offset:          0x6B
+        Addend:          211
+    Name:            .debug_info
+    Payload:         6E00000004000000000004010000000021006F000000000000007F000000020000005B00000002330000000105050300000000033F000000044B0000000E00054400000006B5000000060107BA000000080708020000005B00000004ED00029FCE00000001036A00000006D3000000050400
+  - Type:            CUSTOM
+    Name:            .debug_str
+    Payload:         636C616E672076657273696F6E2031392E302E3067697420282F646174612F70726F6A656374732F6C6C766D2D726F6F742F6C6C766D2D70726F6A6563742F636C616E672032646236373033663063323537643239336466343535653264666638633166623639356334313030290068656C6C6F2D776F726C642E637070002F646174612F70726F6A656374732F736372697074732F72656772657373696F6E2D73756974652F696E7075742F67656E6572616C0063686172005F5F41525241595F53495A455F545950455F5F006D61696E00696E7400
+  - Type:            CUSTOM
+    Relocations:
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x34
+    Name:            .debug_line
+    Payload:         42000000040027000000010101FB0E0D0001010101000000010000010068656C6C6F2D776F726C642E6370700000000000000502020000001505030A0229130867021B000101
+  - Type:            CUSTOM
+    Name:            linking
+    Version:         2
+    SymbolTable:
+      - Index:           0
+        Kind:            FUNCTION
+        Name:            __original_main
+        Flags:           [ VISIBILITY_HIDDEN ]
+        Function:        1
+      - Index:           1
+        Kind:            GLOBAL
+        Name:            __stack_pointer
+        Flags:           [ UNDEFINED ]
+        Global:          0
+      - Index:           2
+        Kind:            DATA
+        Name:            .L.str
+        Flags:           [ BINDING_LOCAL ]
+        Segment:         0
+        Size:            14
+      - Index:           3
+        Kind:            FUNCTION
+        Name:            _Z6printfPKcz
+        Flags:           [ UNDEFINED ]
+        Function:        0
+      - Index:           4
+        Kind:            FUNCTION
+        Name:            main
+        Flags:           [ VISIBILITY_HIDDEN ]
+        Function:        2
+      - Index:           5
+        Kind:            FUNCTION
+        Name:            __main_void
+        Flags:           [ VISIBILITY_HIDDEN ]
+        Function:        1
+      - Index:           6
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         6
+      - Index:           7
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         8
+      - Index:           8
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         9
+    SegmentInfo:
+      - Index:           0
+        Name:            .rodata..L.str
+        Alignment:       0
+        Flags:           [ STRINGS ]
+  - Type:            CUSTOM
+    Name:            producers
+    Languages:
+      - Name:            C_plus_plus_14
+        Version:         ''
+    Tools:
+      - Name:            clang
+        Version:         '19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)'
+  - Type:            CUSTOM
+    Name:            target_features
+    Features:
+      - Prefix:          USED
+        Name:            mutable-globals
+      - Prefix:          USED
+        Name:            sign-ext
+...
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wasm
deleted file mode 100644
index 2ff16db3d1c1753d5c3e15289deb1adf53858ac6..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 1545
zcmcIk&5ImG6n|CK)zj5IANz%w=qlZ~YIK>;ot at 1p7~`rC#IK7V at i6J>sTq2ArhDj*
z!3AM9f(Tx8Pf9=*ya at pze?d;cleYwO$|)cO at f48g!B;(#xT|Ly>Q()I?^my?UcG8?
z;}HP>^2Ncy0gy{{Iwe#3qXLx4U{dOIhJGO3s56qIFxsa8b2?63Z?7{B{UDJMn-ca}
z76HufFRMsLgcPSwBXs}{J#RbArZ(GiG+VQwO&72uZJM{WGjze>h<KYC3gsOgk=~}O
z3avUhM7cIC&rl{QJHj?>vFn)VGuw1U`BoeYku_JAoh-EB6zqbX-*t-UE6!IioRVEC
zS#VwLvrz5HZaV0=-EJf&WRW~mT;{B}aO#QTB3aS_Xq5y-R(#QV$-1z7?zC-T0ysP*
z0JPRIz%9(BzJ|=pmW9e(6(cU`uau9605CYv@;@O&>jX5PB#mV??L+G$>jR8pDS2ZV
zAg_dKP_VMNcyI8lI)ybqg&*|8Uy#(42Q+oD;6SK4{659TupMEe*U;R+M(9Ol+3iPT
z?M_B0nrnB}n5!`!>?Rtn<sQb+egp039&-1w5le{-dbsf5ILcGp#LOq?p<ybNS4#6)
zG&|VNDS5%L=;3M`hk1HfK97CjJv1-Oh?Tdn&%ST4$iSSRHcldM=mrCOBBR(31G}+Z
ztyk*<Ke5l$dT!#@#!<K{y(F#;hm%ny3d3YJn)9{U^k%Qy-l}i(>t1tntJmD#==EEh
zo3h#K_s at Ebez(27>9rd5`tvZ3Dy at yP?RwQ4kKtcS#9ri&aj8fSA{ndwRN~Z6WX%u8
zX;K@=Kt}EmIu{$Q3xRr5Z=`{jpv;Gp81O~GyKdx;;C*~|jm$Q2Vk?nx;`^YwnE;)c
zu+s$0+2_YgL9LKt&NNs<O9=V1SWq2a0H{kid6q1>oT{5;CgGMz*OqxsPxvW4<s~+`
zm4QWl!cQwQ;UeJ$bXkZ at WcfZfjW;>d6RP1V at Pm5yIo!jZ9}K8*ML~{x5sywm7l2WX
zQJv8oe69RuB!{6_-FfG=*BQy>2>hYg#Tk37!1;>MDTq7+vBZ7{@fe1Eoc#sHQvl*Q
zc8!R2c7up5cAJP-*&QO at W_OABnB62s7ZoA9M?}o-6LFca2Sj{@e=aJ%BkW6RTqSTF
zjGqYn4DjuLS64aB5u<@wx}tI|u#S4Eht)?7RfwrOkfgZN84uHVW*RNXqsYU8kiANG
zpYW{YF8%M7dR6Vdl(^AACY`=?lN5`Ru9rq>;&z9!G8l$kcNni5u|EhZ@{{Cmy-`k~

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wat
deleted file mode 100644
index e858b5e1cd21ac..00000000000000
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.wat
+++ /dev/null
@@ -1,75 +0,0 @@
-(module
-  (type (;0;) (func (param i32 i32) (result i32)))
-  (import "env" "__linear_memory" (memory (;0;) 0))
-  (import "env" "__stack_pointer" (global (;0;) (mut i32)))
-  (func $_Z4testii (type 0) (param i32 i32) (result i32)
-    (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
-    global.get 0
-    local.set 2
-    i32.const 32
-    local.set 3
-    local.get 2
-    local.get 3
-    i32.sub
-    local.set 4
-    local.get 4
-    local.get 0
-    i32.store offset=16
-    local.get 4
-    local.get 1
-    i32.store offset=12
-    local.get 4
-    i32.load offset=16
-    local.set 5
-    local.get 4
-    local.get 5
-    i32.store offset=8
-    local.get 4
-    i32.load offset=12
-    local.set 6
-    local.get 4
-    local.get 6
-    i32.store offset=28
-    local.get 4
-    i32.load offset=28
-    local.set 7
-    local.get 4
-    local.get 7
-    i32.store offset=24
-    local.get 4
-    i32.load offset=28
-    local.set 8
-    local.get 4
-    i32.load offset=24
-    local.set 9
-    local.get 8
-    local.get 9
-    i32.add
-    local.set 10
-    local.get 4
-    local.get 10
-    i32.store offset=20
-    local.get 4
-    i32.load offset=20
-    local.set 11
-    local.get 4
-    local.get 11
-    i32.store offset=24
-    local.get 4
-    i32.load offset=24
-    local.set 12
-    local.get 4
-    i32.load offset=8
-    local.set 13
-    local.get 13
-    local.get 12
-    i32.add
-    local.set 14
-    local.get 4
-    local.get 14
-    i32.store offset=8
-    local.get 4
-    i32.load offset=8
-    local.set 15
-    local.get 15
-    return))
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.yaml b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.yaml
new file mode 100644
index 00000000000000..fd7dadce4482b2
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.yaml
@@ -0,0 +1,171 @@
+--- !WASM
+FileHeader:
+  Version:         0x1
+Sections:
+  - Type:            TYPE
+    Signatures:
+      - Index:           0
+        ParamTypes:
+          - I32
+          - I32
+        ReturnTypes:
+          - I32
+  - Type:            IMPORT
+    Imports:
+      - Module:          env
+        Field:           __linear_memory
+        Kind:            MEMORY
+        Memory:
+          Minimum:         0x0
+      - Module:          env
+        Field:           __stack_pointer
+        Kind:            GLOBAL
+        GlobalType:      I32
+        GlobalMutable:   true
+  - Type:            FUNCTION
+    FunctionTypes:   [ 0 ]
+  - Type:            CODE
+    Relocations:
+      - Type:            R_WASM_GLOBAL_INDEX_LEB
+        Index:           1
+        Offset:          0x7
+    Functions:
+      - Index:           0
+        Locals:
+          - Type:            I32
+            Count:           14
+        Body:            238080808000210241202103200220036B2104200420003602102004200136020C2004280210210520042005360208200428020C21062004200636021C200428021C210720042007360218200428021C210820042802182109200820096A210A2004200A3602142004280214210B2004200B3602182004280218210C2004280208210D200D200C6A210E2004200E3602082004280208210F200F0F0B
+  - Type:            CUSTOM
+    Name:            .debug_abbrev
+    Payload:         011101250E1305030E10171B0E110112060000022E016E0E030E3A0B3B0B49133F19200B0000030500030E3A0B3B0B49130000043400030E3A0B3B0B49130000050B010000062400030E3E0B0B0B0000072E011101120640186E0E030E3A0B3B0B49133F1900000805000218030E3A0B3B0B491300000934000218030E3A0B3B0B491300000A1D01311311011206580B590B570B00000B05000218311300000C34000218311300000D0B0111011206000000
+  - Type:            CUSTOM
+    Relocations:
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           2
+        Offset:          0x6
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0xC
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x12
+        Addend:          111
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           4
+        Offset:          0x16
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x1A
+        Addend:          124
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x1E
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x27
+        Addend:          178
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x2B
+        Addend:          198
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x37
+        Addend:          217
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x42
+        Addend:          223
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x4E
+        Addend:          229
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x5B
+        Addend:          213
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x62
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x6F
+        Addend:          235
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x73
+        Addend:          245
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x81
+        Addend:          250
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x8F
+        Addend:          258
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x9D
+        Addend:          266
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0xAC
+        Addend:          64
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0xC8
+        Addend:          78
+    Name:            .debug_info
+    Payload:         D800000004000000000004010000000021006F000000000000007C000000030000009F00000002B2000000C600000001025A0000000103D900000001025A00000004DF00000001035A0000000504E500000001055A000000000006D5000000050407030000009F00000004ED00049FEB000000F5000000010B5A00000008029110FA000000010B5A0000000802910C02010000010B5A000000090291080A010000010C5A0000000A26000000430000003F000000010D080B02911C360000000C029118410000000D510000002A0000000C0291144D00000000000000
+  - Type:            CUSTOM
+    Name:            .debug_str
+    Payload:         636C616E672076657273696F6E2031392E302E3067697420282F646174612F70726F6A656374732F6C6C766D2D726F6F742F6C6C766D2D70726F6A6563742F636C616E672032646236373033663063323537643239336466343535653264666638633166623639356334313030290070722D34333836302E637070002F646174612F70726F6A656374732F736372697074732F72656772657373696F6E2D73756974652F696E7075742F67656E6572616C005F5A3134496E6C696E6546756E6374696F6E6900496E6C696E6546756E6374696F6E00696E7400506172616D005661725F31005661725F32005F5A34746573746969007465737400506172616D5F3100506172616D5F32004100
+  - Type:            CUSTOM
+    Relocations:
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x31
+    Name:            .debug_line
+    Payload:         75000000040024000000010101FB0E0D0001010101000000010000010070722D34333836302E637070000000000000050203000000030A01050B0A0224130507067405170675050F0376D6050706740511067605190674051774050974050D0675050B0674050A0676050579050A084B050306740204000101
+  - Type:            CUSTOM
+    Name:            linking
+    Version:         2
+    SymbolTable:
+      - Index:           0
+        Kind:            FUNCTION
+        Name:            _Z4testii
+        Flags:           [ VISIBILITY_HIDDEN ]
+        Function:        0
+      - Index:           1
+        Kind:            GLOBAL
+        Name:            __stack_pointer
+        Flags:           [ UNDEFINED ]
+        Global:          0
+      - Index:           2
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         4
+      - Index:           3
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         6
+      - Index:           4
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         7
+  - Type:            CUSTOM
+    Name:            producers
+    Languages:
+      - Name:            C_plus_plus_14
+        Version:         ''
+    Tools:
+      - Name:            clang
+        Version:         '19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)'
+  - Type:            CUSTOM
+    Name:            target_features
+    Features:
+      - Prefix:          USED
+        Name:            mutable-globals
+      - Prefix:          USED
+        Name:            sign-ext
+...
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wasm
deleted file mode 100644
index 8833634ab4b48f943a44fa8fb26e867d1f7efc75..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 1783
zcmcIkO^6&t6n<6J)!o%Sf4j5UT at 6B&u9_HT_9wH+CIOQrMp!k*LlhNc($mv3&hE_g
z(9^wcz%XkB!Q`}f6E!!<K?y`$^pZ#piU9-Wno~}}LlEL+!5n<mvr1OH+EDMkdiCD>
zUcL9K!RvPj0FaC8>+3+zkaJ{kh78DnUP%=!=&t6g)pn~Jcu}<zbi(K?1=v>iW6xiy
z_QF;-4k9)n?8DRvh;#kC4%cFAz|NV2r%=5PiYyisl|<4N#UzukKr at m(M>EQh#zn=C
zV;-lJDY-P?QI at n$D4QOm$E2MFX<Sx93gu*oyQqV$DObA6aiya&GLv_26P6v&bK<|D
zrc!(jc^LANl_0N-#Yx4bA$g35h?yWFlhy%hOSXsF3Yj(&Xy!;Eomc}(CqXz{W|mb}
zX0NIoy5tt9p>JWRyv!F;AXPwp;h#_=!%(9bswhWgF;-)8OcoQhOOD80%W53UGJzfw
z%W6_iZs$6lcVP>oLAG2EYDu%|)oM|&N=C at jxguw|!o=>}2zh-1fKCC+J at 2|Mwxx{c
zqvo;6ZjR*+yGPum;?c(d3=VYiZv_Ca?AV%a>I7ho!%}f*hMj=BA0WEBjo#`u!e3Eo
z=o2vX$bf=SGyL8kvXs)R$hg69N}z?yxDV{oCJNVZ5%P>y(T&WVboV1tU>zj4aiyj=
zP`HVUu<KeyH}dz=-7iQv-LN0%9lwm!)KOm^s*Q(QExthtmd4o9d&ANI6tg83&|CV<
zpm&iO2EC8W#FH-{Epp^_n?YZvzJg2Vbu_&y3i|s*PqnjMl71ZdZM2uGLDX-BT{(NG
zJX4-&wqm(wy6(l^bT0~*13&Ihx7(|oQWS>qP}<f{58dbLwF3ud_BUqyx%q?jxkLNw
zjmrFdFjsFh7W~;p?ZBaVzcM>Bvln_%sZv>3sFeL)5B>$w_oG%1p`xG}1$~`Qsh_ms
zV7k at qCGm7K=mwG327IYdeS3e+iyDAL%Z)Jf0SP4CeyiCH>QWmmX*X!JLobHcyvXZ-
z|1R3U;kA<hmR>y#i}iX?hZkQtwRjrf(?@4T|12(GwG5a-N(lKgm(@&H5*OKd4^-;L
z>Y5Wi<=78QIya)eSA6m%YM>jQ={}6{yhHbnam%#N^Ihf|f5MFUZY{?=`z9}%3D2V@
z`vrH*_xLD^1w3RiozOA9)lIfAv6WW0N$s at f7A9zI*Mb%>U7~lo8jRxjnv7bE+Hgs`
zI#JLL{qpfsFPvc9a)^}>>jK98gMhV(^YyX5|H#njkr%@!gvmf;IEYdHJBV=;#N+%S
zh$jsY&+ at CpE(3 at oe3OWy{2CD_`5j`vML{(94I-BLO(NF#Jt96L`~k5y2>ltv=Y&5b
z;%maUi1?21^Hlsm_$?xSBK$59w+O#a;IhuSxFen6WSfSKwX_ZR4Q!i&ouRi0e5S2;
zCa+s)Q+pO|Phw}%_6i)^dg9}-Q(Mn{;xz-3J6`Rzlm3v*Rv?2$KF(iIFV)Txo=*6g
u|NUWnrEidry{H+))kfgO3BCckFW*UGuhtGq&30Jx+WmdD9`I7I7XJks<cWR&

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wat
deleted file mode 100644
index 90ea3456b055d8..00000000000000
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.wat
+++ /dev/null
@@ -1,149 +0,0 @@
-(module
-  (type (;0;) (func (param f32) (result i32)))
-  (type (;1;) (func (param i32) (result i32)))
-  (import "env" "__linear_memory" (memory (;0;) 0))
-  (import "env" "__stack_pointer" (global (;0;) (mut i32)))
-  (func $_Z3barf (type 0) (param f32) (result i32)
-    (local i32 i32 i32 f32 f32 f32 i32 i32 i32 i32 i32 i32)
-    global.get 0
-    local.set 1
-    i32.const 16
-    local.set 2
-    local.get 1
-    local.get 2
-    i32.sub
-    local.set 3
-    local.get 3
-    local.get 0
-    f32.store offset=12
-    local.get 3
-    f32.load offset=12
-    local.set 4
-    local.get 4
-    f32.abs
-    local.set 5
-    f32.const 0x1p+31 (;=2.14748e+09;)
-    local.set 6
-    local.get 5
-    local.get 6
-    f32.lt
-    local.set 7
-    local.get 7
-    i32.eqz
-    local.set 8
-    block  ;; label = @1
-      block  ;; label = @2
-        local.get 8
-        br_if 0 (;@2;)
-        local.get 4
-        i32.trunc_f32_s
-        local.set 9
-        local.get 9
-        local.set 10
-        br 1 (;@1;)
-      end
-      i32.const -2147483648
-      local.set 11
-      local.get 11
-      local.set 10
-    end
-    local.get 10
-    local.set 12
-    local.get 12
-    return)
-  (func $_Z3fooc (type 1) (param i32) (result i32)
-    (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 f32 f32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
-    global.get 0
-    local.set 1
-    i32.const 16
-    local.set 2
-    local.get 1
-    local.get 2
-    i32.sub
-    local.set 3
-    local.get 3
-    global.set 0
-    local.get 3
-    local.get 0
-    i32.store8 offset=15
-    local.get 3
-    i32.load8_u offset=15
-    local.set 4
-    i32.const 24
-    local.set 5
-    local.get 4
-    local.get 5
-    i32.shl
-    local.set 6
-    local.get 6
-    local.get 5
-    i32.shr_s
-    local.set 7
-    local.get 3
-    local.get 7
-    i32.store offset=8
-    local.get 3
-    i32.load offset=8
-    local.set 8
-    local.get 3
-    i32.load8_u offset=15
-    local.set 9
-    i32.const 24
-    local.set 10
-    local.get 9
-    local.get 10
-    i32.shl
-    local.set 11
-    local.get 11
-    local.get 10
-    i32.shr_s
-    local.set 12
-    local.get 8
-    local.get 12
-    i32.add
-    local.set 13
-    local.get 13
-    f32.convert_i32_s
-    local.set 14
-    local.get 3
-    local.get 14
-    f32.store offset=4
-    local.get 3
-    f32.load offset=4
-    local.set 15
-    local.get 15
-    call $_Z3barf
-    local.set 16
-    local.get 3
-    local.get 16
-    i32.store offset=8
-    local.get 3
-    i32.load offset=8
-    local.set 17
-    local.get 3
-    i32.load8_u offset=15
-    local.set 18
-    i32.const 24
-    local.set 19
-    local.get 18
-    local.get 19
-    i32.shl
-    local.set 20
-    local.get 20
-    local.get 19
-    i32.shr_s
-    local.set 21
-    local.get 17
-    local.get 21
-    i32.add
-    local.set 22
-    i32.const 16
-    local.set 23
-    local.get 3
-    local.get 23
-    i32.add
-    local.set 24
-    local.get 24
-    global.set 0
-    local.get 22
-    return))
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.yaml b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.yaml
new file mode 100644
index 00000000000000..4ca82d549f0959
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.yaml
@@ -0,0 +1,241 @@
+--- !WASM
+FileHeader:
+  Version:         0x1
+Sections:
+  - Type:            TYPE
+    Signatures:
+      - Index:           0
+        ParamTypes:
+          - F32
+        ReturnTypes:
+          - I32
+      - Index:           1
+        ParamTypes:
+          - I32
+        ReturnTypes:
+          - I32
+  - Type:            IMPORT
+    Imports:
+      - Module:          env
+        Field:           __linear_memory
+        Kind:            MEMORY
+        Memory:
+          Minimum:         0x0
+      - Module:          env
+        Field:           __stack_pointer
+        Kind:            GLOBAL
+        GlobalType:      I32
+        GlobalMutable:   true
+  - Type:            FUNCTION
+    FunctionTypes:   [ 0, 1 ]
+  - Type:            CODE
+    Relocations:
+      - Type:            R_WASM_GLOBAL_INDEX_LEB
+        Index:           1
+        Offset:          0xA
+      - Type:            R_WASM_GLOBAL_INDEX_LEB
+        Index:           1
+        Offset:          0x75
+      - Type:            R_WASM_GLOBAL_INDEX_LEB
+        Index:           1
+        Offset:          0x8A
+      - Type:            R_WASM_FUNCTION_INDEX_LEB
+        Index:           0
+        Offset:          0xF3
+      - Type:            R_WASM_GLOBAL_INDEX_LEB
+        Index:           1
+        Offset:          0x136
+    Functions:
+      - Index:           0
+        Locals:
+          - Type:            I32
+            Count:           3
+          - Type:            F32
+            Count:           3
+          - Type:            I32
+            Count:           6
+        Body:            238080808000210141102102200120026B21032003200038020C20032A020C210420048B2105430000004F2106200520065D210720074521080240024020080D002004A821092009210A0C010B418080808078210B200B210A0B200A210C200C0F0B
+      - Index:           1
+        Locals:
+          - Type:            I32
+            Count:           13
+          - Type:            F32
+            Count:           2
+          - Type:            I32
+            Count:           9
+        Body:            238080808000210141102102200120026B21032003248080808000200320003A000F20032D000F2104411821052004200574210620062005752107200320073602082003280208210820032D000F21094118210A2009200A74210B200B200A75210C2008200C6A210D200DB2210E2003200E38020420032A0204210F200F1080808080002110200320103602082003280208211120032D000F2112411821132012201374211420142013752115201120156A211641102117200320176A2118201824808080800020160F0B
+  - Type:            CUSTOM
+    Name:            .debug_abbrev
+    Payload:         011101250E1305030E10171B0E110155170000022400030E3E0B0B0B0000032E011101120640186E0E030E3A0B3B0B49133F1900000405000218030E3A0B3B0B491300000534000218030E3A0B3B0B49130000060B011101120600000716004913030E3A0B3B0B000000
+  - Type:            CUSTOM
+    Relocations:
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x6
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0xC
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0x12
+        Addend:          111
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           6
+        Offset:          0x16
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0x1A
+        Addend:          124
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           4
+        Offset:          0x22
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0x27
+        Addend:          178
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x2E
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0x3B
+        Addend:          182
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0x3F
+        Addend:          190
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0x4D
+        Addend:          219
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           2
+        Offset:          0x59
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0x66
+        Addend:          194
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0x6A
+        Addend:          202
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0x78
+        Addend:          231
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0x86
+        Addend:          242
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           2
+        Offset:          0x91
+        Addend:          73
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0x9D
+        Addend:          252
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0xAD
+        Addend:          248
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0xB8
+        Addend:          258
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0xC0
+        Addend:          206
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0xC7
+        Addend:          225
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0xCE
+        Addend:          237
+    Name:            .debug_info
+    Payload:         D100000004000000000004010000000021006F000000000000007C000000000000000000000002B2000000050403020000006900000004ED00039FB6000000BE0000000101260000000402910CDB0000000101C600000000036D000000D200000004ED00039FC2000000CA0000000103BF0000000402910FE70000000103CD00000005029108F20000000105A800000006B60000004B00000005029104FC0000000109B3000000000726000000F8000000010407C60000000201000001070002CE000000070402E1000000040402ED000000060100
+  - Type:            CUSTOM
+    Relocations:
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x0
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x4
+        Addend:          105
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           2
+        Offset:          0x8
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           2
+        Offset:          0xC
+        Addend:          210
+    Name:            .debug_ranges
+    Payload:         020000006B0000006D0000003F0100000000000000000000
+  - Type:            CUSTOM
+    Name:            .debug_str
+    Payload:         636C616E672076657273696F6E2031392E302E3067697420282F646174612F70726F6A656374732F6C6C766D2D726F6F742F6C6C766D2D70726F6A6563742F636C616E672032646236373033663063323537643239336466343535653264666638633166623639356334313030290070722D34343838342E637070002F646174612F70726F6A656374732F736372697074732F72656772657373696F6E2D73756974652F696E7075742F67656E6572616C00696E74005F5A336261726600626172005F5A33666F6F6300666F6F00756E7369676E656420696E7400496E70757400666C6F617400506172616D00636861720056616C756500494E5400416464656400464C4F415400
+  - Type:            CUSTOM
+    Relocations:
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x31
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           2
+        Offset:          0x4D
+    Name:            .debug_line
+    Payload:         8A000000040024000000010101FB0E0D0001010101000000010000010070722D34343838342E6370700000000000000502020000000105240A08F20602321121B92105184A02040001010005026D00000014050F0A022914050706088205150678051D0674051B0882051574050D5805130675050F0674050D9E050A067705120674051008820503740217000101
+  - Type:            CUSTOM
+    Name:            linking
+    Version:         2
+    SymbolTable:
+      - Index:           0
+        Kind:            FUNCTION
+        Name:            _Z3barf
+        Flags:           [ VISIBILITY_HIDDEN ]
+        Function:        0
+      - Index:           1
+        Kind:            GLOBAL
+        Name:            __stack_pointer
+        Flags:           [ UNDEFINED ]
+        Global:          0
+      - Index:           2
+        Kind:            FUNCTION
+        Name:            _Z3fooc
+        Flags:           [ VISIBILITY_HIDDEN ]
+        Function:        1
+      - Index:           3
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         4
+      - Index:           4
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         6
+      - Index:           5
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         7
+      - Index:           6
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         8
+  - Type:            CUSTOM
+    Name:            producers
+    Languages:
+      - Name:            C_plus_plus_14
+        Version:         ''
+    Tools:
+      - Name:            clang
+        Version:         '19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)'
+  - Type:            CUSTOM
+    Name:            target_features
+    Features:
+      - Prefix:          USED
+        Name:            mutable-globals
+      - Prefix:          USED
+        Name:            sign-ext
+...
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wasm
deleted file mode 100644
index c3465cfe8f16fc7b2b5072c1c41b53ab4cdf8335..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 1117
zcmcIi&1=*^6n}4$>}Hy7`USQs$QCLpWk0&z-L@)f at g#_sQUovCBs&{ov&oW777Ida
zK}5m3c+o#V5K8H(;Gx%EdiUTzApQY*@Xc-uRnHF0`~1C+nfJg+y9faIa%X1;a076g
zeO4mVMARQ^wZb40PSWa%Zk%i}z*BQ79dEPMi-SmtMB7GfcMuPwF9v+%?SNT`+p9PW
zMHsWJS3|@qSX6MAa8M|>g`4>;$8{6Y#|gY at PZ^p$K7HAqz{wl{tAl1gn7VuMrgh6=
zGXUBYHZ9GzEM)-D3j at DWmPs|H;k-9j29 at UCOk``e!l+CD`8f)@V_6gc at LKg@o%Rt#
zop_6ky7GXo{sm?sR*cSbx{R)hV|zrF=%Q(8#6U9+m4>MA6Mv{=0}SI}U}TUx3(S8X
zz&{+3<5)R)Ml^py#Gta at R68T5?W8jCLMQTzeUYR=92FN<%GGk!4`lIrrR_+k(o5o}
z!joww4Ex<u6322Vo!TqI at LJn#E>#yhRj<}qYS&g4+nsu&A!_YTXW3imxXqP at S6`@B
zZ$K|8)tmKZv+VVH at K=e{OM)JiN`#+?RP|Fzvp|YU5cM)y at kJyOCxkUvhxLfOuqKnt
zlhArnmm-yYP!woi=;3M;&OTi&*ll{g4s+^15P#YQ#RgkRhCiDk2pHN37|b9^<H$?`
z!xxn?PpLM8$Y<t9rRFH5c~%{DT%%+f%dv6Ln5i*tyiq93mEANglM}uweIgNI?3K at L
zM1Gvp`1q&}d{X}b{DJ}elKu<KD**hOzK6yl0$<S&k+16e$RFtkXg&rgxElBMBjlU<
zG4j5Cg7EI&3hMbBO<Ht#uZGWQcJ0igi8E6TKXZJ6_Wf2b%+euQsKY3MJQ{*%m)tEh
w24mj%@7wW7bw4JZ#22#F5su7g5!n1#H<OMVijp73t`ny7W*YcWNj#Ik0WMPvu>b%7

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wat
deleted file mode 100644
index b9421ad40cb83b..00000000000000
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.wat
+++ /dev/null
@@ -1,11 +0,0 @@
-(module
-  (type (;0;) (func (result i32)))
-  (import "env" "__linear_memory" (memory (;0;) 1))
-  (import "env" "__stack_pointer" (global (;0;) (mut i32)))
-  (func $_Z4testv (type 0) (result i32)
-    (local i32)
-    i32.const 1
-    local.set 0
-    local.get 0
-    return)
-  (data $S (i32.const 0) "\00"))
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.yaml b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.yaml
new file mode 100644
index 00000000000000..5afc9fbd638811
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.yaml
@@ -0,0 +1,169 @@
+--- !WASM
+FileHeader:
+  Version:         0x1
+Sections:
+  - Type:            TYPE
+    Signatures:
+      - Index:           0
+        ParamTypes:      []
+        ReturnTypes:
+          - I32
+  - Type:            IMPORT
+    Imports:
+      - Module:          env
+        Field:           __linear_memory
+        Kind:            MEMORY
+        Memory:
+          Minimum:         0x1
+      - Module:          env
+        Field:           __stack_pointer
+        Kind:            GLOBAL
+        GlobalType:      I32
+        GlobalMutable:   true
+  - Type:            FUNCTION
+    FunctionTypes:   [ 0 ]
+  - Type:            DATACOUNT
+    Count:           1
+  - Type:            CODE
+    Functions:
+      - Index:           0
+        Locals:
+          - Type:            I32
+            Count:           1
+        Body:            4101210020000F0B
+  - Type:            DATA
+    Segments:
+      - SectionOffset:   6
+        InitFlags:       0
+        Offset:
+          Opcode:          I32_CONST
+          Value:           0
+        Content:         '00'
+  - Type:            CUSTOM
+    Name:            .debug_abbrev
+    Payload:         011101250E1305030E10171B0E110112060000023400030E49133F193A0B3B0B02180000031301360B030E0B0B3A0B3B0B0000040D00030E49133A0B3B0B380B0000051700360B030E0B0B3A0B3B0B0000062E001101120640186E0E030E3A0B3B0B49133F190000072400030E3E0B0B0B000000
+  - Type:            CUSTOM
+    Relocations:
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           2
+        Offset:          0x6
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           4
+        Offset:          0xC
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           4
+        Offset:          0x12
+        Addend:          111
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           5
+        Offset:          0x16
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           4
+        Offset:          0x1A
+        Addend:          124
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x1E
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           4
+        Offset:          0x27
+        Addend:          178
+      - Type:            R_WASM_MEMORY_ADDR_I32
+        Index:           1
+        Offset:          0x33
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           4
+        Offset:          0x39
+        Addend:          188
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           4
+        Offset:          0x41
+        Addend:          180
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           4
+        Offset:          0x4E
+        Addend:          182
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x57
+      - Type:            R_WASM_GLOBAL_INDEX_I32
+        Index:           3
+        Offset:          0x62
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           4
+        Offset:          0x67
+        Addend:          195
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           4
+        Offset:          0x6B
+        Addend:          204
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           4
+        Offset:          0x76
+        Addend:          209
+    Name:            .debug_info
+    Payload:         7900000004000000000004010000000021006F000000000000007C000000020000000B00000002B20000003700000001080503000000000305BC00000001010104B40000004C0000000105000505B60000000101020006020000000B00000007ED03000000009FC3000000CC00000001097500000007D1000000050400
+  - Type:            CUSTOM
+    Name:            .debug_str
+    Payload:         636C616E672076657273696F6E2031392E302E3067697420282F646174612F70726F6A656374732F6C6C766D2D726F6F742F6C6C766D2D70726F6A6563742F636C616E672032646236373033663063323537643239336466343535653264666638633166623639356334313030290070722D34363436362E637070002F646174612F70726F6A656374732F736372697074732F72656772657373696F6E2D73756974652F696E7075742F67656E6572616C0053005500556E696F6E00537472756374005F5A347465737476007465737400696E7400
+  - Type:            CUSTOM
+    Relocations:
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x34
+        Addend:          3
+    Name:            .debug_line
+    Payload:         3C000000040024000000010101FB0E0D0001010101000000010000010070722D34363436362E637070000000000005030A000502050000000309010208000101
+  - Type:            CUSTOM
+    Name:            linking
+    Version:         2
+    SymbolTable:
+      - Index:           0
+        Kind:            FUNCTION
+        Name:            _Z4testv
+        Flags:           [ VISIBILITY_HIDDEN ]
+        Function:        0
+      - Index:           1
+        Kind:            DATA
+        Name:            S
+        Flags:           [ VISIBILITY_HIDDEN ]
+        Segment:         0
+        Size:            1
+      - Index:           2
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         6
+      - Index:           3
+        Kind:            GLOBAL
+        Name:            __stack_pointer
+        Flags:           [ UNDEFINED ]
+        Global:          0
+      - Index:           4
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         8
+      - Index:           5
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         9
+    SegmentInfo:
+      - Index:           0
+        Name:            .bss.S
+        Alignment:       0
+        Flags:           [  ]
+  - Type:            CUSTOM
+    Name:            producers
+    Languages:
+      - Name:            C_plus_plus_14
+        Version:         ''
+    Tools:
+      - Name:            clang
+        Version:         '19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)'
+  - Type:            CUSTOM
+    Name:            target_features
+    Features:
+      - Prefix:          USED
+        Name:            mutable-globals
+      - Prefix:          USED
+        Name:            sign-ext
+...
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wasm b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wasm
deleted file mode 100644
index b3c9b2eb4a897b519d580037f823e3c8db3c4666..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 1394
zcmcIjOK%)S5U%Q;SMRLXvDXR)A~YjjM$ta}+QdN$HpZX`<XFK-h|6YXws$r0?94JV
zYuQNA8UzS#@rejULgK=KBpl!rp&W8Tgj0S&j$AAb9D+n7sNS_9z?qTi^{J++yXtH3
zvMvGuezLc>2Y8VW1_K<hZ&bv%jJL;|%_xkemo~eyo20u8;1JGoFW74Kk}%F?$_L0l
z7?yy-A47W??ZMOJ?Sacz99MI=qiwmmqdU-G(`2y0rX1!P<Qiw7?C2FJyXFeImSZ~B
zyRKl%Y}pZOW3Xbn1<EQkSdm<tT)V+e6p_3cHsuxxC=xIXPq<^w*tiWJzfYaVsx9gF
zJ5A5`Q at M>3_-v`H^U|@$o-9q^qyfOH1Wp>u({YKH&e$*7=gKcVPB+wnO&<XOnmx<{
z&=>xJ8^_^Xd6WiVJ_EdT*0yZ`Yn*TZ@!Ze={G`reAD$(Q+sXGdagBtu8a}v?C_~>4
z35^&oD|_T<2cUm(laN~^$gYs)Y=8RBF#2p1P2C$t*GEzLU>JQ%T6=@kG>Ojkiw_m7
zt1 at 7yGCH+K4b0oh*NiX8+$BM at z9J)3ig{lt&3r(Hq4<ytz*X8c6b^5c<!KOkamU$~
zX%;52GrLr+SL>ZHcV=oWFZXJ_G`S>$JgY^~cDIryNj~xp@!IJ3xt8BJRiAIygSo|1
zt+}Q7R(oM_QO>p6?bE?*+ixr_1`D(G`U{ZDEUyN=9{j6(7NlX1+N83R%1oW5lJ&z}
z*21{g&ubkS%hZdY`ObVhNj6>&FZn<Y5QAaEOTF$!p2E5H&5g|qqxh{j3p=rFLI2Qk
z{z`p0Nh0u-T0Ou1=H|-!ruuX3wY3WXKP%QB?OVN`w`pV=IHVEr_tKa$YVm6Ne_w_G
zwI#LnvThbwt!(6a*|5&)`VE7>_k&(AW^``kd?(k@;KE at x6@sr-H<Q|Ig>i>j*Hoxe
zJNuDqvSY*;jWdHY6RxO?LMo#qsIH!WWsRe0ApEM(i4pn;RrRtk7>FVVG0A at caa;rO
z1pf`Jr-<jz6Gs;KO%$j3EflZvJ192!Jrq7aK&uNsg4pE`QGAO0BPRBd-$ro_`CSw@
zkl#n~9r6bVSO42s&CEorLX-Ghy&XYBY4ro57qb-8`d&w3X|>sl`q at a$E<llz0@}K4
zRs3Dlhn%|jzf<wLI{kR=r5%|!+tSPX#5{I#yxY$`Ka!PBl=xnhowO8_Dsm_P6MdLO
AV*mgE

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wat b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wat
deleted file mode 100644
index 57640b699dc4a0..00000000000000
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.wat
+++ /dev/null
@@ -1,63 +0,0 @@
-(module
-  (type (;0;) (func (param i32 i32 i32) (result i32)))
-  (import "env" "__linear_memory" (memory (;0;) 0))
-  (import "env" "__stack_pointer" (global (;0;) (mut i32)))
-  (func $_Z3fooPKijb (type 0) (param i32 i32 i32) (result i32)
-    (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
-    global.get 0
-    local.set 3
-    i32.const 32
-    local.set 4
-    local.get 3
-    local.get 4
-    i32.sub
-    local.set 5
-    local.get 5
-    local.get 0
-    i32.store offset=24
-    local.get 5
-    local.get 1
-    i32.store offset=20
-    local.get 2
-    local.set 6
-    local.get 5
-    local.get 6
-    i32.store8 offset=19
-    local.get 5
-    i32.load8_u offset=19
-    local.set 7
-    i32.const 1
-    local.set 8
-    local.get 7
-    local.get 8
-    i32.and
-    local.set 9
-    block  ;; label = @1
-      block  ;; label = @2
-        local.get 9
-        i32.eqz
-        br_if 0 (;@2;)
-        i32.const 7
-        local.set 10
-        local.get 5
-        local.get 10
-        i32.store offset=12
-        i32.const 7
-        local.set 11
-        local.get 5
-        local.get 11
-        i32.store offset=28
-        br 1 (;@1;)
-      end
-      local.get 5
-      i32.load offset=20
-      local.set 12
-      local.get 5
-      local.get 12
-      i32.store offset=28
-    end
-    local.get 5
-    i32.load offset=28
-    local.set 13
-    local.get 13
-    return))
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.yaml b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.yaml
new file mode 100644
index 00000000000000..183bccf872f5ad
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.yaml
@@ -0,0 +1,168 @@
+--- !WASM
+FileHeader:
+  Version:         0x1
+Sections:
+  - Type:            TYPE
+    Signatures:
+      - Index:           0
+        ParamTypes:
+          - I32
+          - I32
+          - I32
+        ReturnTypes:
+          - I32
+  - Type:            IMPORT
+    Imports:
+      - Module:          env
+        Field:           __linear_memory
+        Kind:            MEMORY
+        Memory:
+          Minimum:         0x0
+      - Module:          env
+        Field:           __stack_pointer
+        Kind:            GLOBAL
+        GlobalType:      I32
+        GlobalMutable:   true
+  - Type:            FUNCTION
+    FunctionTypes:   [ 0 ]
+  - Type:            CODE
+    Relocations:
+      - Type:            R_WASM_GLOBAL_INDEX_LEB
+        Index:           1
+        Offset:          0x6
+    Functions:
+      - Index:           0
+        Locals:
+          - Type:            I32
+            Count:           11
+        Body:            238080808000210341202104200320046B2105200520003602182005200136021420022106200520063A001320052D001321074101210820072008712109024002402009450D004107210A2005200A36020C4107210B2005200B36021C0C010B2005280214210C2005200C36021C0B200528021C210D200D0F0B
+  - Type:            CUSTOM
+    Name:            .debug_abbrev
+    Payload:         011101250E1305030E10171B0E110112060000022E011101120640186E0E030E3A0B3B0B49133F1900000305000218030E3A0B3B0B49130000040B011101120600000534000218030E3A0B3B0B491300000616004913030E3A0B3B0B0000072400030E3E0B0B0B0000080F00491300000926004913000000
+  - Type:            CUSTOM
+    Relocations:
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           2
+        Offset:          0x6
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0xC
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x12
+        Addend:          111
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           4
+        Offset:          0x16
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x1A
+        Addend:          120
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x1E
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x27
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x34
+        Addend:          174
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x38
+        Addend:          186
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x46
+        Addend:          194
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x54
+        Addend:          210
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x62
+        Addend:          237
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x6D
+        Addend:          74
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x79
+        Addend:          252
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x89
+        Addend:          261
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x91
+        Addend:          190
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0x9C
+        Addend:          203
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0xAD
+        Addend:          224
+      - Type:            R_WASM_SECTION_OFFSET_I32
+        Index:           3
+        Offset:          0xB4
+        Addend:          247
+    Name:            .debug_info
+    Payload:         BC00000004000000000004010000000021006F0000000000000078000000020000007D00000002020000007D00000004ED00059FAE000000BA00000001029000000003029118C200000001029700000003029114D20000000102AC00000003029113ED0000000102B3000000044C000000180000000502910CFC0000000105BA0000000006900000000501000001040007BE000000050406A2000000CB000000010108A7000000099000000007E0000000070407F70000000201098400000000
+  - Type:            CUSTOM
+    Name:            .debug_str
+    Payload:         636C616E672076657273696F6E2031392E302E3067697420282F646174612F70726F6A656374732F6C6C766D2D726F6F742F6C6C766D2D70726F6A6563742F636C616E6720326462363730336630633235376432393364663435356532646666386331666236393563343130302900746573742E637070002F646174612F70726F6A656374732F736372697074732F72656772657373696F6E2D73756974652F696E7075742F67656E6572616C005F5A33666F6F504B696A6200666F6F00696E7400506172616D50747200494E5450545200506172616D556E7369676E656400756E7369676E656420696E7400506172616D426F6F6C00626F6F6C00434F4E5354414E5400494E544547455200
+  - Type:            CUSTOM
+    Relocations:
+      - Type:            R_WASM_FUNCTION_OFFSET_I32
+        Index:           0
+        Offset:          0x2D
+    Name:            .debug_line
+    Payload:         58000000040020000000010101FB0E0D00010101010000000100000100746573742E6370700000000000000502020000001305070A022F130674051306083E0505AD06037AC8050A062805030674037874050106030920020B000101
+  - Type:            CUSTOM
+    Name:            linking
+    Version:         2
+    SymbolTable:
+      - Index:           0
+        Kind:            FUNCTION
+        Name:            _Z3fooPKijb
+        Flags:           [ VISIBILITY_HIDDEN ]
+        Function:        0
+      - Index:           1
+        Kind:            GLOBAL
+        Name:            __stack_pointer
+        Flags:           [ UNDEFINED ]
+        Global:          0
+      - Index:           2
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         4
+      - Index:           3
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         6
+      - Index:           4
+        Kind:            SECTION
+        Flags:           [ BINDING_LOCAL ]
+        Section:         7
+  - Type:            CUSTOM
+    Name:            producers
+    Languages:
+      - Name:            C_plus_plus_14
+        Version:         ''
+    Tools:
+      - Name:            clang
+        Version:         '19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)'
+  - Type:            CUSTOM
+    Name:            target_features
+    Features:
+      - Prefix:          USED
+        Name:            mutable-globals
+      - Prefix:          USED
+        Name:            sign-ext
+...
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt
deleted file mode 100644
index 0511c4b7e805b3..00000000000000
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-LLVM WebAssembly limitations
-----------------------------
-LLVM does not support any conversion between the binary format (.wasm)
-and the text format (.wat):
-
-  .wasm -> .wat
-  .wat  -> .wasm
-
-WebAssembly external tools
---------------------------
-These tools are intended for use in (or for development of) toolchains
-or other systems that want to manipulate WebAssembly files.
-
-  Development of WebAssembly and associated infrastructure
-  https://github.com/WebAssembly
-
-  WABT: The WebAssembly Binary Toolkit
-  https://github.com/WebAssembly/wabt
-
-  wasm2wat — translate from the binary format to the text format
-  https://webassembly.github.io/wabt/doc/wasm2wat.1.html
-
-  wat2wasm — translate from WebAssembly text format to the WebAssembly binary format
-  https://webassembly.github.io/wabt/doc/wat2wasm.1.html
-
-How to generate .wasm from .cpp
--------------------------------
-Each test includes its C++ source. To generate the .wasm for any of
-the tests (ie. hello-world.cpp):
-
-For target=wasm64
-  clang --target=wasm64 -c -w -g -O0 -o hello-world.wasm hello-world.cpp
-
-or
-
-For target=wasm32
-  clang --target=wasm32 -c -w -g -O0 -o hello-world.wasm hello-world.cpp
-
-How to generate .wasm from .wat
--------------------------------
-Using the 'wasm2wat' and 'wat2wasm' (WABT: The WebAssembly Binary Toolkit),
-we can generate the WebAssembly text format file.
-
-For target=wasm64
-  wasm2wat hello-world.wasm --enable-memory64 -o hello-world.wat
-
-For target=wasm32
-  wat2wasm hello-world.wat -o hello-world.wasm
-
-Notes:
-------
-* The tests run the .wasm file (target=wasm32).
-* The .wat files were generated using WABT wasm2wat tool and are included
-  only for extra information.

>From aa8370615ecfc251ffb583aaafe9ee0903e06e48 Mon Sep 17 00:00:00 2001
From: Carlos Alberto Enciso <carlos.alberto.enciso at gmail.com>
Date: Wed, 28 Feb 2024 12:43:32 +0000
Subject: [PATCH 5/7] [llvm-debuginfo-analyzer] Add support for WebAssembly
 binary format.

Add support for the WebAssembly binary format and be able to
generate logical views.

https://github.com/llvm/llvm-project/issues/69181

- Remove the YAML files used in the tests and replace them
  with the .s files.
- Add the README.txt with instructions on how to generate
  the .s and .wasm files from the .cpp.
---
 .../01-wasm-compare-logical-elements.test     |   3 +-
 .../01-wasm-print-basic-details.test          |   3 +-
 .../01-wasm-select-logical-elements.test      |   3 +-
 .../WebAssembly/02-wasm-logical-lines.test    |   3 +-
 ...-wasm-incorrect-lexical-scope-typedef.test |   3 +-
 .../04-wasm-missing-nested-enumerators.test   |   3 +-
 ...wasm-incorrect-lexical-scope-variable.test |   3 +-
 .../06-wasm-full-logical-view.test            |   3 +-
 .../WebAssembly/Inputs/hello-world-clang.s    | 286 ++++++++++
 .../WebAssembly/Inputs/hello-world-clang.yaml | 210 --------
 .../WebAssembly/Inputs/pr-43860-clang.s       | 457 ++++++++++++++++
 .../WebAssembly/Inputs/pr-43860-clang.yaml    | 171 ------
 .../WebAssembly/Inputs/pr-44884-clang.s       | 488 ++++++++++++++++++
 .../WebAssembly/Inputs/pr-44884-clang.yaml    | 241 ---------
 .../WebAssembly/Inputs/pr-46466-clang.s       | 259 ++++++++++
 .../WebAssembly/Inputs/pr-46466-clang.yaml    | 169 ------
 .../WebAssembly/Inputs/test-clang.s           | 366 +++++++++++++
 .../WebAssembly/Inputs/test-clang.yaml        | 168 ------
 .../WebAssembly/README.txt                    |  28 +
 19 files changed, 1900 insertions(+), 967 deletions(-)
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.s
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.yaml
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.s
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.yaml
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.s
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.yaml
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.s
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.yaml
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.s
 delete mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.yaml
 create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test
index 7461fa6f26372c..634a041b648fb4 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test
@@ -17,7 +17,8 @@
 ; The output shows in view form the 'missing (-), added (+)' elements,
 ; giving more context by swapping the reference and target object files.
 
-; RUN: yaml2obj %p/Inputs/test-clang.yaml -o test-clang.wasm
+; RUN: llvm-mc -arch=wasm32 -filetype=obj \
+; RUN:         %p/Inputs/test-clang.s -o test-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level \
 ; RUN:                         --compare=types \
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
index 112083231b1340..e29d67bf5adb2e 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
@@ -18,7 +18,8 @@
 ; sorted by the debug information internal offset; it includes its lexical
 ; level and debug info format.
 
-; RUN: yaml2obj %p/Inputs/test-clang.yaml -o test-clang.wasm
+; RUN: llvm-mc -arch=wasm32 -filetype=obj \
+; RUN:         %p/Inputs/test-clang.s -o test-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format \
 ; RUN:                         --output-sort=offset \
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
index 516924e36b9977..569381b00a8968 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
@@ -18,7 +18,8 @@
 ; contain 'BLOCK' or '.store' in their names or types, using a tab layout
 ; and given the number of matches.
 
-# RUN: yaml2obj %p/Inputs/test-clang.yaml -o test-clang.wasm
+; RUN: llvm-mc -arch=wasm32 -filetype=obj \
+; RUN:         %p/Inputs/test-clang.s -o test-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level \
 ; RUN:                         --select-nocase --select-regex \
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
index e9aeb7b444f35b..3e4204778bb679 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
@@ -15,7 +15,8 @@
 ; The logical views shows the intermixed lines and assembler instructions,
 ; allowing to compare the code generated by the different toolchains.
 
-; RUN: yaml2obj %p/Inputs/hello-world-clang.yaml -o hello-world-clang.wasm
+; RUN: llvm-mc -arch=wasm32 -filetype=obj \
+; RUN:         %p/Inputs/hello-world-clang.s -o hello-world-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
 ; RUN:                         --print=lines,instructions \
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test
index ced55618d04e43..88bb02fc340252 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test
@@ -30,7 +30,8 @@
 ; emits both typedefs at the same lexical scope (3), which is wrong.
 ; GCC emit correct lexical scope for both typedefs.
 
-; RUN: yaml2obj %p/Inputs/pr-44884-clang.yaml -o pr-44884-clang.wasm
+; RUN: llvm-mc -arch=wasm32 -filetype=obj \
+; RUN:         %p/Inputs/pr-44884-clang.s -o pr-44884-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
 ; RUN:                         --output-sort=kind \
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test
index 6e13f25aa582c1..254610cd7ebe08 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test
@@ -25,7 +25,8 @@
 ; references to the enumerators 'RED' and 'BLUE'. The DWARF generated
 ; by GCC, does include such references.
 
-; RUN: yaml2obj %p/Inputs/pr-46466-clang.yaml -o pr-46466-clang.wasm
+; RUN: llvm-mc -arch=wasm32 -filetype=obj \
+; RUN:         %p/Inputs/pr-46466-clang.s -o pr-46466-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
 ; RUN:                         --output-sort=name \
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test
index f1214d9b6d23ee..26e792d9f3fc78 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test
@@ -31,7 +31,8 @@
 ; The DWARF generated by GCC/Clang show those variables at the correct
 ; lexical scope: '3' and '4' respectively.
 
-; RUN: yaml2obj %p/Inputs/pr-43860-clang.yaml -o pr-43860-clang.wasm
+; RUN: llvm-mc -arch=wasm32 -filetype=obj \
+; RUN:         %p/Inputs/pr-43860-clang.s -o pr-43860-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
 ; RUN:                         --output-sort=name \
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
index ddb93a71145f16..1e7e2073f869f4 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
@@ -18,7 +18,8 @@
 ; offsets within the debug information section, debug location
 ; operands, linkage names, etc.
 
-; RUN: yaml2obj %p/Inputs/test-clang.yaml -o test-clang.wasm
+; RUN: llvm-mc -arch=wasm32 -filetype=obj \
+; RUN:         %p/Inputs/test-clang.s -o test-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=all \
 ; RUN:                         --print=all \
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.s b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.s
new file mode 100644
index 00000000000000..bfba259b626b0f
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.s
@@ -0,0 +1,286 @@
+	.text
+	.file	"hello-world.cpp"
+	.file	1 "/data/projects/scripts/regression-suite/input/general" "hello-world.cpp"
+	.globaltype	__stack_pointer, i32
+	.functype	__original_main () -> (i32)
+	.functype	_Z6printfPKcz (i32, i32) -> (i32)
+	.functype	main (i32, i32) -> (i32)
+	.section	.text.__original_main,"",@
+	.hidden	__original_main                 # -- Begin function __original_main
+	.globl	__original_main
+	.type	__original_main, at function
+__original_main:                        # @__original_main
+.Lfunc_begin0:
+	.loc	1 4 0                           # hello-world.cpp:4:0
+	.functype	__original_main () -> (i32)
+	.local  	i32, i32, i32, i32, i32, i32, i32, i32, i32
+# %bb.0:                                # %entry
+	global.get	__stack_pointer
+	local.set	0
+	i32.const	16
+	local.set	1
+	local.get	0
+	local.get	1
+	i32.sub 
+	local.set	2
+	local.get	2
+	global.set	__stack_pointer
+	i32.const	0
+	local.set	3
+	local.get	2
+	local.get	3
+	i32.store	12
+.Ltmp0:
+	.loc	1 5 3 prologue_end              # hello-world.cpp:5:3
+	i32.const	.L.str
+	local.set	4
+	i32.const	0
+	local.set	5
+	local.get	4
+	local.get	5
+	call	_Z6printfPKcz
+	drop
+	.loc	1 6 3                           # hello-world.cpp:6:3
+	i32.const	0
+	local.set	6
+	i32.const	16
+	local.set	7
+	local.get	2
+	local.get	7
+	i32.add 
+	local.set	8
+	local.get	8
+	global.set	__stack_pointer
+	local.get	6
+	return
+	end_function
+.Ltmp1:
+.Lfunc_end0:
+                                        # -- End function
+	.section	.text.main,"",@
+	.hidden	main                            # -- Begin function main
+	.globl	main
+	.type	main, at function
+main:                                   # @main
+.Lfunc_begin1:
+	.functype	main (i32, i32) -> (i32)
+	.local  	i32
+# %bb.0:                                # %body
+	call	__original_main
+	local.set	2
+	local.get	2
+	return
+	end_function
+.Lfunc_end1:
+                                        # -- End function
+	.type	.L.str, at object                  # @.str
+	.section	.rodata..L.str,"S",@
+.L.str:
+	.asciz	"Hello, World\n"
+	.size	.L.str, 14
+
+	.globl	__main_void
+	.type	__main_void, at function
+	.hidden	__main_void
+.set __main_void, __original_main
+	.section	.debug_abbrev,"",@
+	.int8	1                               # Abbreviation Code
+	.int8	17                              # DW_TAG_compile_unit
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	37                              # DW_AT_producer
+	.int8	14                              # DW_FORM_strp
+	.int8	19                              # DW_AT_language
+	.int8	5                               # DW_FORM_data2
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	16                              # DW_AT_stmt_list
+	.int8	23                              # DW_FORM_sec_offset
+	.int8	27                              # DW_AT_comp_dir
+	.int8	14                              # DW_FORM_strp
+	.int8	17                              # DW_AT_low_pc
+	.int8	1                               # DW_FORM_addr
+	.int8	18                              # DW_AT_high_pc
+	.int8	6                               # DW_FORM_data4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	2                               # Abbreviation Code
+	.int8	52                              # DW_TAG_variable
+	.int8	0                               # DW_CHILDREN_no
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	2                               # DW_AT_location
+	.int8	24                              # DW_FORM_exprloc
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	3                               # Abbreviation Code
+	.int8	1                               # DW_TAG_array_type
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	4                               # Abbreviation Code
+	.int8	33                              # DW_TAG_subrange_type
+	.int8	0                               # DW_CHILDREN_no
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	55                              # DW_AT_count
+	.int8	11                              # DW_FORM_data1
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	5                               # Abbreviation Code
+	.int8	38                              # DW_TAG_const_type
+	.int8	0                               # DW_CHILDREN_no
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	6                               # Abbreviation Code
+	.int8	36                              # DW_TAG_base_type
+	.int8	0                               # DW_CHILDREN_no
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	62                              # DW_AT_encoding
+	.int8	11                              # DW_FORM_data1
+	.int8	11                              # DW_AT_byte_size
+	.int8	11                              # DW_FORM_data1
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	7                               # Abbreviation Code
+	.int8	36                              # DW_TAG_base_type
+	.int8	0                               # DW_CHILDREN_no
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	11                              # DW_AT_byte_size
+	.int8	11                              # DW_FORM_data1
+	.int8	62                              # DW_AT_encoding
+	.int8	11                              # DW_FORM_data1
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	8                               # Abbreviation Code
+	.int8	46                              # DW_TAG_subprogram
+	.int8	0                               # DW_CHILDREN_no
+	.int8	17                              # DW_AT_low_pc
+	.int8	1                               # DW_FORM_addr
+	.int8	18                              # DW_AT_high_pc
+	.int8	6                               # DW_FORM_data4
+	.int8	64                              # DW_AT_frame_base
+	.int8	24                              # DW_FORM_exprloc
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	63                              # DW_AT_external
+	.int8	25                              # DW_FORM_flag_present
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	0                               # EOM(3)
+	.section	.debug_info,"",@
+.Lcu_begin0:
+	.int32	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
+.Ldebug_info_start0:
+	.int16	4                               # DWARF version number
+	.int32	.debug_abbrev0                  # Offset Into Abbrev. Section
+	.int8	4                               # Address Size (in bytes)
+	.int8	1                               # Abbrev [1] 0xb:0x67 DW_TAG_compile_unit
+	.int32	.Linfo_string0                  # DW_AT_producer
+	.int16	33                              # DW_AT_language
+	.int32	.Linfo_string1                  # DW_AT_name
+	.int32	.Lline_table_start0             # DW_AT_stmt_list
+	.int32	.Linfo_string2                  # DW_AT_comp_dir
+	.int32	.Lfunc_begin0                   # DW_AT_low_pc
+	.int32	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
+	.int8	2                               # Abbrev [2] 0x26:0xd DW_TAG_variable
+	.int32	51                              # DW_AT_type
+	.int8	1                               # DW_AT_decl_file
+	.int8	5                               # DW_AT_decl_line
+	.int8	5                               # DW_AT_location
+	.int8	3
+	.int32	.L.str
+	.int8	3                               # Abbrev [3] 0x33:0xc DW_TAG_array_type
+	.int32	63                              # DW_AT_type
+	.int8	4                               # Abbrev [4] 0x38:0x6 DW_TAG_subrange_type
+	.int32	75                              # DW_AT_type
+	.int8	14                              # DW_AT_count
+	.int8	0                               # End Of Children Mark
+	.int8	5                               # Abbrev [5] 0x3f:0x5 DW_TAG_const_type
+	.int32	68                              # DW_AT_type
+	.int8	6                               # Abbrev [6] 0x44:0x7 DW_TAG_base_type
+	.int32	.Linfo_string3                  # DW_AT_name
+	.int8	6                               # DW_AT_encoding
+	.int8	1                               # DW_AT_byte_size
+	.int8	7                               # Abbrev [7] 0x4b:0x7 DW_TAG_base_type
+	.int32	.Linfo_string4                  # DW_AT_name
+	.int8	8                               # DW_AT_byte_size
+	.int8	7                               # DW_AT_encoding
+	.int8	8                               # Abbrev [8] 0x52:0x18 DW_TAG_subprogram
+	.int32	.Lfunc_begin0                   # DW_AT_low_pc
+	.int32	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
+	.int8	4                               # DW_AT_frame_base
+	.int8	237
+	.int8	0
+	.int8	2
+	.int8	159
+	.int32	.Linfo_string5                  # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	3                               # DW_AT_decl_line
+	.int32	106                             # DW_AT_type
+                                        # DW_AT_external
+	.int8	6                               # Abbrev [6] 0x6a:0x7 DW_TAG_base_type
+	.int32	.Linfo_string6                  # DW_AT_name
+	.int8	5                               # DW_AT_encoding
+	.int8	4                               # DW_AT_byte_size
+	.int8	0                               # End Of Children Mark
+.Ldebug_info_end0:
+	.section	.debug_str,"S",@
+.Linfo_string0:
+	.asciz	"clang version 19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)" # string offset=0
+.Linfo_string1:
+	.asciz	"hello-world.cpp"               # string offset=111
+.Linfo_string2:
+	.asciz	"/data/projects/scripts/regression-suite/input/general" # string offset=127
+.Linfo_string3:
+	.asciz	"char"                          # string offset=181
+.Linfo_string4:
+	.asciz	"__ARRAY_SIZE_TYPE__"           # string offset=186
+.Linfo_string5:
+	.asciz	"main"                          # string offset=206
+.Linfo_string6:
+	.asciz	"int"                           # string offset=211
+	.ident	"clang version 19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)"
+	.no_dead_strip	__indirect_function_table
+	.section	.custom_section.producers,"",@
+	.int8	2
+	.int8	8
+	.ascii	"language"
+	.int8	1
+	.int8	14
+	.ascii	"C_plus_plus_14"
+	.int8	0
+	.int8	12
+	.ascii	"processed-by"
+	.int8	1
+	.int8	5
+	.ascii	"clang"
+	.int8	96
+	.ascii	"19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)"
+	.section	.debug_str,"S",@
+	.section	.custom_section.target_features,"",@
+	.int8	2
+	.int8	43
+	.int8	15
+	.ascii	"mutable-globals"
+	.int8	43
+	.int8	8
+	.ascii	"sign-ext"
+	.section	.debug_str,"S",@
+	.section	.debug_line,"",@
+.Lline_table_start0:
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.yaml b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.yaml
deleted file mode 100644
index 6cba3c0ddb9a59..00000000000000
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/hello-world-clang.yaml
+++ /dev/null
@@ -1,210 +0,0 @@
---- !WASM
-FileHeader:
-  Version:         0x1
-Sections:
-  - Type:            TYPE
-    Signatures:
-      - Index:           0
-        ParamTypes:      []
-        ReturnTypes:
-          - I32
-      - Index:           1
-        ParamTypes:
-          - I32
-          - I32
-        ReturnTypes:
-          - I32
-  - Type:            IMPORT
-    Imports:
-      - Module:          env
-        Field:           __linear_memory
-        Kind:            MEMORY
-        Memory:
-          Minimum:         0x1
-      - Module:          env
-        Field:           __stack_pointer
-        Kind:            GLOBAL
-        GlobalType:      I32
-        GlobalMutable:   true
-      - Module:          env
-        Field:           _Z6printfPKcz
-        Kind:            FUNCTION
-        SigIndex:        1
-      - Module:          env
-        Field:           __indirect_function_table
-        Kind:            TABLE
-        Table:
-          Index:           0
-          ElemType:        FUNCREF
-          Limits:
-            Minimum:         0x0
-  - Type:            FUNCTION
-    FunctionTypes:   [ 0, 1 ]
-  - Type:            DATACOUNT
-    Count:           1
-  - Type:            CODE
-    Relocations:
-      - Type:            R_WASM_GLOBAL_INDEX_LEB
-        Index:           1
-        Offset:          0x6
-      - Type:            R_WASM_GLOBAL_INDEX_LEB
-        Index:           1
-        Offset:          0x1B
-      - Type:            R_WASM_MEMORY_ADDR_SLEB
-        Index:           2
-        Offset:          0x2C
-      - Type:            R_WASM_FUNCTION_INDEX_LEB
-        Index:           3
-        Offset:          0x3C
-      - Type:            R_WASM_GLOBAL_INDEX_LEB
-        Index:           1
-        Offset:          0x54
-      - Type:            R_WASM_FUNCTION_INDEX_LEB
-        Index:           0
-        Offset:          0x62
-    Functions:
-      - Index:           1
-        Locals:
-          - Type:            I32
-            Count:           9
-        Body:            238080808000210041102101200020016B21022002248080808000410021032002200336020C418080808000210441002105200420051080808080001A4100210641102107200220076A2108200824808080800020060F0B
-      - Index:           2
-        Locals:
-          - Type:            I32
-            Count:           1
-        Body:            108180808000210220020F0B
-  - Type:            DATA
-    Segments:
-      - SectionOffset:   6
-        InitFlags:       0
-        Offset:
-          Opcode:          I32_CONST
-          Value:           0
-        Content:         48656C6C6F2C20576F726C640A00
-  - Type:            CUSTOM
-    Name:            .debug_abbrev
-    Payload:         011101250E1305030E10171B0E11011206000002340049133A0B3B0B02180000030101491300000421004913370B000005260049130000062400030E3E0B0B0B0000072400030E0B0B3E0B0000082E00110112064018030E3A0B3B0B49133F19000000
-  - Type:            CUSTOM
-    Relocations:
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           6
-        Offset:          0x6
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           7
-        Offset:          0xC
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           7
-        Offset:          0x12
-        Addend:          111
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           8
-        Offset:          0x16
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           7
-        Offset:          0x1A
-        Addend:          127
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x1E
-      - Type:            R_WASM_MEMORY_ADDR_I32
-        Index:           2
-        Offset:          0x2F
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           7
-        Offset:          0x45
-        Addend:          181
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           7
-        Offset:          0x4C
-        Addend:          186
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x53
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           7
-        Offset:          0x60
-        Addend:          206
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           7
-        Offset:          0x6B
-        Addend:          211
-    Name:            .debug_info
-    Payload:         6E00000004000000000004010000000021006F000000000000007F000000020000005B00000002330000000105050300000000033F000000044B0000000E00054400000006B5000000060107BA000000080708020000005B00000004ED00029FCE00000001036A00000006D3000000050400
-  - Type:            CUSTOM
-    Name:            .debug_str
-    Payload:         636C616E672076657273696F6E2031392E302E3067697420282F646174612F70726F6A656374732F6C6C766D2D726F6F742F6C6C766D2D70726F6A6563742F636C616E672032646236373033663063323537643239336466343535653264666638633166623639356334313030290068656C6C6F2D776F726C642E637070002F646174612F70726F6A656374732F736372697074732F72656772657373696F6E2D73756974652F696E7075742F67656E6572616C0063686172005F5F41525241595F53495A455F545950455F5F006D61696E00696E7400
-  - Type:            CUSTOM
-    Relocations:
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x34
-    Name:            .debug_line
-    Payload:         42000000040027000000010101FB0E0D0001010101000000010000010068656C6C6F2D776F726C642E6370700000000000000502020000001505030A0229130867021B000101
-  - Type:            CUSTOM
-    Name:            linking
-    Version:         2
-    SymbolTable:
-      - Index:           0
-        Kind:            FUNCTION
-        Name:            __original_main
-        Flags:           [ VISIBILITY_HIDDEN ]
-        Function:        1
-      - Index:           1
-        Kind:            GLOBAL
-        Name:            __stack_pointer
-        Flags:           [ UNDEFINED ]
-        Global:          0
-      - Index:           2
-        Kind:            DATA
-        Name:            .L.str
-        Flags:           [ BINDING_LOCAL ]
-        Segment:         0
-        Size:            14
-      - Index:           3
-        Kind:            FUNCTION
-        Name:            _Z6printfPKcz
-        Flags:           [ UNDEFINED ]
-        Function:        0
-      - Index:           4
-        Kind:            FUNCTION
-        Name:            main
-        Flags:           [ VISIBILITY_HIDDEN ]
-        Function:        2
-      - Index:           5
-        Kind:            FUNCTION
-        Name:            __main_void
-        Flags:           [ VISIBILITY_HIDDEN ]
-        Function:        1
-      - Index:           6
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         6
-      - Index:           7
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         8
-      - Index:           8
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         9
-    SegmentInfo:
-      - Index:           0
-        Name:            .rodata..L.str
-        Alignment:       0
-        Flags:           [ STRINGS ]
-  - Type:            CUSTOM
-    Name:            producers
-    Languages:
-      - Name:            C_plus_plus_14
-        Version:         ''
-    Tools:
-      - Name:            clang
-        Version:         '19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)'
-  - Type:            CUSTOM
-    Name:            target_features
-    Features:
-      - Prefix:          USED
-        Name:            mutable-globals
-      - Prefix:          USED
-        Name:            sign-ext
-...
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.s b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.s
new file mode 100644
index 00000000000000..fb70b36173fd97
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.s
@@ -0,0 +1,457 @@
+	.text
+	.file	"pr-43860.cpp"
+	.globaltype	__stack_pointer, i32
+	.functype	_Z4testii (i32, i32) -> (i32)
+	.section	.text._Z4testii,"",@
+	.hidden	_Z4testii                       # -- Begin function _Z4testii
+	.globl	_Z4testii
+	.type	_Z4testii, at function
+_Z4testii:                              # @_Z4testii
+.Lfunc_begin0:
+	.file	1 "/data/projects/scripts/regression-suite/input/general" "pr-43860.cpp"
+	.loc	1 11 0                          # pr-43860.cpp:11:0
+	.functype	_Z4testii (i32, i32) -> (i32)
+	.local  	i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32
+# %bb.0:                                # %entry
+	global.get	__stack_pointer
+	local.set	2
+	i32.const	32
+	local.set	3
+	local.get	2
+	local.get	3
+	i32.sub 
+	local.set	4
+	local.get	4
+	local.get	0
+	i32.store	16
+	local.get	4
+	local.get	1
+	i32.store	12
+.Ltmp0:
+	.loc	1 12 11 prologue_end            # pr-43860.cpp:12:11
+	local.get	4
+	i32.load	16
+	local.set	5
+	.loc	1 12 7 is_stmt 0                # pr-43860.cpp:12:7
+	local.get	4
+	local.get	5
+	i32.store	8
+	.loc	1 13 23 is_stmt 1               # pr-43860.cpp:13:23
+	local.get	4
+	i32.load	12
+	local.set	6
+	local.get	4
+	local.get	6
+	i32.store	28
+.Ltmp1:
+	.loc	1 3 15                          # pr-43860.cpp:3:15
+	local.get	4
+	i32.load	28
+	local.set	7
+	.loc	1 3 7 is_stmt 0                 # pr-43860.cpp:3:7
+	local.get	4
+	local.get	7
+	i32.store	24
+.Ltmp2:
+	.loc	1 5 17 is_stmt 1                # pr-43860.cpp:5:17
+	local.get	4
+	i32.load	28
+	local.set	8
+	.loc	1 5 25 is_stmt 0                # pr-43860.cpp:5:25
+	local.get	4
+	i32.load	24
+	local.set	9
+	.loc	1 5 23                          # pr-43860.cpp:5:23
+	local.get	8
+	local.get	9
+	i32.add 
+	local.set	10
+	.loc	1 5 9                           # pr-43860.cpp:5:9
+	local.get	4
+	local.get	10
+	i32.store	20
+	.loc	1 6 13 is_stmt 1                # pr-43860.cpp:6:13
+	local.get	4
+	i32.load	20
+	local.set	11
+	.loc	1 6 11 is_stmt 0                # pr-43860.cpp:6:11
+	local.get	4
+	local.get	11
+	i32.store	24
+.Ltmp3:
+	.loc	1 8 10 is_stmt 1                # pr-43860.cpp:8:10
+	local.get	4
+	i32.load	24
+	local.set	12
+.Ltmp4:
+	.loc	1 13 5                          # pr-43860.cpp:13:5
+	local.get	4
+	i32.load	8
+	local.set	13
+	local.get	13
+	local.get	12
+	i32.add 
+	local.set	14
+	local.get	4
+	local.get	14
+	i32.store	8
+	.loc	1 14 10                         # pr-43860.cpp:14:10
+	local.get	4
+	i32.load	8
+	local.set	15
+	.loc	1 14 3 is_stmt 0                # pr-43860.cpp:14:3
+	local.get	15
+	return
+	end_function
+.Ltmp5:
+.Lfunc_end0:
+                                        # -- End function
+	.section	.debug_abbrev,"",@
+	.int8	1                               # Abbreviation Code
+	.int8	17                              # DW_TAG_compile_unit
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	37                              # DW_AT_producer
+	.int8	14                              # DW_FORM_strp
+	.int8	19                              # DW_AT_language
+	.int8	5                               # DW_FORM_data2
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	16                              # DW_AT_stmt_list
+	.int8	23                              # DW_FORM_sec_offset
+	.int8	27                              # DW_AT_comp_dir
+	.int8	14                              # DW_FORM_strp
+	.int8	17                              # DW_AT_low_pc
+	.int8	1                               # DW_FORM_addr
+	.int8	18                              # DW_AT_high_pc
+	.int8	6                               # DW_FORM_data4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	2                               # Abbreviation Code
+	.int8	46                              # DW_TAG_subprogram
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	110                             # DW_AT_linkage_name
+	.int8	14                              # DW_FORM_strp
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	63                              # DW_AT_external
+	.int8	25                              # DW_FORM_flag_present
+	.int8	32                              # DW_AT_inline
+	.int8	11                              # DW_FORM_data1
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	3                               # Abbreviation Code
+	.int8	5                               # DW_TAG_formal_parameter
+	.int8	0                               # DW_CHILDREN_no
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	4                               # Abbreviation Code
+	.int8	52                              # DW_TAG_variable
+	.int8	0                               # DW_CHILDREN_no
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	5                               # Abbreviation Code
+	.int8	11                              # DW_TAG_lexical_block
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	6                               # Abbreviation Code
+	.int8	36                              # DW_TAG_base_type
+	.int8	0                               # DW_CHILDREN_no
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	62                              # DW_AT_encoding
+	.int8	11                              # DW_FORM_data1
+	.int8	11                              # DW_AT_byte_size
+	.int8	11                              # DW_FORM_data1
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	7                               # Abbreviation Code
+	.int8	46                              # DW_TAG_subprogram
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	17                              # DW_AT_low_pc
+	.int8	1                               # DW_FORM_addr
+	.int8	18                              # DW_AT_high_pc
+	.int8	6                               # DW_FORM_data4
+	.int8	64                              # DW_AT_frame_base
+	.int8	24                              # DW_FORM_exprloc
+	.int8	110                             # DW_AT_linkage_name
+	.int8	14                              # DW_FORM_strp
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	63                              # DW_AT_external
+	.int8	25                              # DW_FORM_flag_present
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	8                               # Abbreviation Code
+	.int8	5                               # DW_TAG_formal_parameter
+	.int8	0                               # DW_CHILDREN_no
+	.int8	2                               # DW_AT_location
+	.int8	24                              # DW_FORM_exprloc
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	9                               # Abbreviation Code
+	.int8	52                              # DW_TAG_variable
+	.int8	0                               # DW_CHILDREN_no
+	.int8	2                               # DW_AT_location
+	.int8	24                              # DW_FORM_exprloc
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	10                              # Abbreviation Code
+	.int8	29                              # DW_TAG_inlined_subroutine
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	49                              # DW_AT_abstract_origin
+	.int8	19                              # DW_FORM_ref4
+	.int8	17                              # DW_AT_low_pc
+	.int8	1                               # DW_FORM_addr
+	.int8	18                              # DW_AT_high_pc
+	.int8	6                               # DW_FORM_data4
+	.int8	88                              # DW_AT_call_file
+	.int8	11                              # DW_FORM_data1
+	.int8	89                              # DW_AT_call_line
+	.int8	11                              # DW_FORM_data1
+	.int8	87                              # DW_AT_call_column
+	.int8	11                              # DW_FORM_data1
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	11                              # Abbreviation Code
+	.int8	5                               # DW_TAG_formal_parameter
+	.int8	0                               # DW_CHILDREN_no
+	.int8	2                               # DW_AT_location
+	.int8	24                              # DW_FORM_exprloc
+	.int8	49                              # DW_AT_abstract_origin
+	.int8	19                              # DW_FORM_ref4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	12                              # Abbreviation Code
+	.int8	52                              # DW_TAG_variable
+	.int8	0                               # DW_CHILDREN_no
+	.int8	2                               # DW_AT_location
+	.int8	24                              # DW_FORM_exprloc
+	.int8	49                              # DW_AT_abstract_origin
+	.int8	19                              # DW_FORM_ref4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	13                              # Abbreviation Code
+	.int8	11                              # DW_TAG_lexical_block
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	17                              # DW_AT_low_pc
+	.int8	1                               # DW_FORM_addr
+	.int8	18                              # DW_AT_high_pc
+	.int8	6                               # DW_FORM_data4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	0                               # EOM(3)
+	.section	.debug_info,"",@
+.Lcu_begin0:
+	.int32	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
+.Ldebug_info_start0:
+	.int16	4                               # DWARF version number
+	.int32	.debug_abbrev0                  # Offset Into Abbrev. Section
+	.int8	4                               # Address Size (in bytes)
+	.int8	1                               # Abbrev [1] 0xb:0xd1 DW_TAG_compile_unit
+	.int32	.Linfo_string0                  # DW_AT_producer
+	.int16	33                              # DW_AT_language
+	.int32	.Linfo_string1                  # DW_AT_name
+	.int32	.Lline_table_start0             # DW_AT_stmt_list
+	.int32	.Linfo_string2                  # DW_AT_comp_dir
+	.int32	.Lfunc_begin0                   # DW_AT_low_pc
+	.int32	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
+	.int8	2                               # Abbrev [2] 0x26:0x34 DW_TAG_subprogram
+	.int32	.Linfo_string3                  # DW_AT_linkage_name
+	.int32	.Linfo_string4                  # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	2                               # DW_AT_decl_line
+	.int32	90                              # DW_AT_type
+                                        # DW_AT_external
+	.int8	1                               # DW_AT_inline
+	.int8	3                               # Abbrev [3] 0x36:0xb DW_TAG_formal_parameter
+	.int32	.Linfo_string6                  # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	2                               # DW_AT_decl_line
+	.int32	90                              # DW_AT_type
+	.int8	4                               # Abbrev [4] 0x41:0xb DW_TAG_variable
+	.int32	.Linfo_string7                  # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	3                               # DW_AT_decl_line
+	.int32	90                              # DW_AT_type
+	.int8	5                               # Abbrev [5] 0x4c:0xd DW_TAG_lexical_block
+	.int8	4                               # Abbrev [4] 0x4d:0xb DW_TAG_variable
+	.int32	.Linfo_string8                  # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	5                               # DW_AT_decl_line
+	.int32	90                              # DW_AT_type
+	.int8	0                               # End Of Children Mark
+	.int8	0                               # End Of Children Mark
+	.int8	6                               # Abbrev [6] 0x5a:0x7 DW_TAG_base_type
+	.int32	.Linfo_string5                  # DW_AT_name
+	.int8	5                               # DW_AT_encoding
+	.int8	4                               # DW_AT_byte_size
+	.int8	7                               # Abbrev [7] 0x61:0x7a DW_TAG_subprogram
+	.int32	.Lfunc_begin0                   # DW_AT_low_pc
+	.int32	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
+	.int8	4                               # DW_AT_frame_base
+	.int8	237
+	.int8	0
+	.int8	4
+	.int8	159
+	.int32	.Linfo_string9                  # DW_AT_linkage_name
+	.int32	.Linfo_string10                 # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	11                              # DW_AT_decl_line
+	.int32	90                              # DW_AT_type
+                                        # DW_AT_external
+	.int8	8                               # Abbrev [8] 0x7d:0xe DW_TAG_formal_parameter
+	.int8	2                               # DW_AT_location
+	.int8	145
+	.int8	16
+	.int32	.Linfo_string11                 # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	11                              # DW_AT_decl_line
+	.int32	90                              # DW_AT_type
+	.int8	8                               # Abbrev [8] 0x8b:0xe DW_TAG_formal_parameter
+	.int8	2                               # DW_AT_location
+	.int8	145
+	.int8	12
+	.int32	.Linfo_string12                 # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	11                              # DW_AT_decl_line
+	.int32	90                              # DW_AT_type
+	.int8	9                               # Abbrev [9] 0x99:0xe DW_TAG_variable
+	.int8	2                               # DW_AT_location
+	.int8	145
+	.int8	8
+	.int32	.Linfo_string13                 # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	12                              # DW_AT_decl_line
+	.int32	90                              # DW_AT_type
+	.int8	10                              # Abbrev [10] 0xa7:0x33 DW_TAG_inlined_subroutine
+	.int32	38                              # DW_AT_abstract_origin
+	.int32	.Ltmp1                          # DW_AT_low_pc
+	.int32	.Ltmp4-.Ltmp1                   # DW_AT_high_pc
+	.int8	1                               # DW_AT_call_file
+	.int8	13                              # DW_AT_call_line
+	.int8	8                               # DW_AT_call_column
+	.int8	11                              # Abbrev [11] 0xb7:0x8 DW_TAG_formal_parameter
+	.int8	2                               # DW_AT_location
+	.int8	145
+	.int8	28
+	.int32	54                              # DW_AT_abstract_origin
+	.int8	12                              # Abbrev [12] 0xbf:0x8 DW_TAG_variable
+	.int8	2                               # DW_AT_location
+	.int8	145
+	.int8	24
+	.int32	65                              # DW_AT_abstract_origin
+	.int8	13                              # Abbrev [13] 0xc7:0x12 DW_TAG_lexical_block
+	.int32	.Ltmp2                          # DW_AT_low_pc
+	.int32	.Ltmp3-.Ltmp2                   # DW_AT_high_pc
+	.int8	12                              # Abbrev [12] 0xd0:0x8 DW_TAG_variable
+	.int8	2                               # DW_AT_location
+	.int8	145
+	.int8	20
+	.int32	77                              # DW_AT_abstract_origin
+	.int8	0                               # End Of Children Mark
+	.int8	0                               # End Of Children Mark
+	.int8	0                               # End Of Children Mark
+	.int8	0                               # End Of Children Mark
+.Ldebug_info_end0:
+	.section	.debug_str,"S",@
+.Linfo_string0:
+	.asciz	"clang version 19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)" # string offset=0
+.Linfo_string1:
+	.asciz	"pr-43860.cpp"                  # string offset=111
+.Linfo_string2:
+	.asciz	"/data/projects/scripts/regression-suite/input/general" # string offset=124
+.Linfo_string3:
+	.asciz	"_Z14InlineFunctioni"           # string offset=178
+.Linfo_string4:
+	.asciz	"InlineFunction"                # string offset=198
+.Linfo_string5:
+	.asciz	"int"                           # string offset=213
+.Linfo_string6:
+	.asciz	"Param"                         # string offset=217
+.Linfo_string7:
+	.asciz	"Var_1"                         # string offset=223
+.Linfo_string8:
+	.asciz	"Var_2"                         # string offset=229
+.Linfo_string9:
+	.asciz	"_Z4testii"                     # string offset=235
+.Linfo_string10:
+	.asciz	"test"                          # string offset=245
+.Linfo_string11:
+	.asciz	"Param_1"                       # string offset=250
+.Linfo_string12:
+	.asciz	"Param_2"                       # string offset=258
+.Linfo_string13:
+	.asciz	"A"                             # string offset=266
+	.ident	"clang version 19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)"
+	.section	.custom_section.producers,"",@
+	.int8	2
+	.int8	8
+	.ascii	"language"
+	.int8	1
+	.int8	14
+	.ascii	"C_plus_plus_14"
+	.int8	0
+	.int8	12
+	.ascii	"processed-by"
+	.int8	1
+	.int8	5
+	.ascii	"clang"
+	.int8	96
+	.ascii	"19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)"
+	.section	.debug_str,"S",@
+	.section	.custom_section.target_features,"",@
+	.int8	2
+	.int8	43
+	.int8	15
+	.ascii	"mutable-globals"
+	.int8	43
+	.int8	8
+	.ascii	"sign-ext"
+	.section	.debug_str,"S",@
+	.section	.debug_line,"",@
+.Lline_table_start0:
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.yaml b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.yaml
deleted file mode 100644
index fd7dadce4482b2..00000000000000
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-43860-clang.yaml
+++ /dev/null
@@ -1,171 +0,0 @@
---- !WASM
-FileHeader:
-  Version:         0x1
-Sections:
-  - Type:            TYPE
-    Signatures:
-      - Index:           0
-        ParamTypes:
-          - I32
-          - I32
-        ReturnTypes:
-          - I32
-  - Type:            IMPORT
-    Imports:
-      - Module:          env
-        Field:           __linear_memory
-        Kind:            MEMORY
-        Memory:
-          Minimum:         0x0
-      - Module:          env
-        Field:           __stack_pointer
-        Kind:            GLOBAL
-        GlobalType:      I32
-        GlobalMutable:   true
-  - Type:            FUNCTION
-    FunctionTypes:   [ 0 ]
-  - Type:            CODE
-    Relocations:
-      - Type:            R_WASM_GLOBAL_INDEX_LEB
-        Index:           1
-        Offset:          0x7
-    Functions:
-      - Index:           0
-        Locals:
-          - Type:            I32
-            Count:           14
-        Body:            238080808000210241202103200220036B2104200420003602102004200136020C2004280210210520042005360208200428020C21062004200636021C200428021C210720042007360218200428021C210820042802182109200820096A210A2004200A3602142004280214210B2004200B3602182004280218210C2004280208210D200D200C6A210E2004200E3602082004280208210F200F0F0B
-  - Type:            CUSTOM
-    Name:            .debug_abbrev
-    Payload:         011101250E1305030E10171B0E110112060000022E016E0E030E3A0B3B0B49133F19200B0000030500030E3A0B3B0B49130000043400030E3A0B3B0B49130000050B010000062400030E3E0B0B0B0000072E011101120640186E0E030E3A0B3B0B49133F1900000805000218030E3A0B3B0B491300000934000218030E3A0B3B0B491300000A1D01311311011206580B590B570B00000B05000218311300000C34000218311300000D0B0111011206000000
-  - Type:            CUSTOM
-    Relocations:
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           2
-        Offset:          0x6
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0xC
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x12
-        Addend:          111
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           4
-        Offset:          0x16
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x1A
-        Addend:          124
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x1E
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x27
-        Addend:          178
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x2B
-        Addend:          198
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x37
-        Addend:          217
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x42
-        Addend:          223
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x4E
-        Addend:          229
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x5B
-        Addend:          213
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x62
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x6F
-        Addend:          235
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x73
-        Addend:          245
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x81
-        Addend:          250
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x8F
-        Addend:          258
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x9D
-        Addend:          266
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0xAC
-        Addend:          64
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0xC8
-        Addend:          78
-    Name:            .debug_info
-    Payload:         D800000004000000000004010000000021006F000000000000007C000000030000009F00000002B2000000C600000001025A0000000103D900000001025A00000004DF00000001035A0000000504E500000001055A000000000006D5000000050407030000009F00000004ED00049FEB000000F5000000010B5A00000008029110FA000000010B5A0000000802910C02010000010B5A000000090291080A010000010C5A0000000A26000000430000003F000000010D080B02911C360000000C029118410000000D510000002A0000000C0291144D00000000000000
-  - Type:            CUSTOM
-    Name:            .debug_str
-    Payload:         636C616E672076657273696F6E2031392E302E3067697420282F646174612F70726F6A656374732F6C6C766D2D726F6F742F6C6C766D2D70726F6A6563742F636C616E672032646236373033663063323537643239336466343535653264666638633166623639356334313030290070722D34333836302E637070002F646174612F70726F6A656374732F736372697074732F72656772657373696F6E2D73756974652F696E7075742F67656E6572616C005F5A3134496E6C696E6546756E6374696F6E6900496E6C696E6546756E6374696F6E00696E7400506172616D005661725F31005661725F32005F5A34746573746969007465737400506172616D5F3100506172616D5F32004100
-  - Type:            CUSTOM
-    Relocations:
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x31
-    Name:            .debug_line
-    Payload:         75000000040024000000010101FB0E0D0001010101000000010000010070722D34333836302E637070000000000000050203000000030A01050B0A0224130507067405170675050F0376D6050706740511067605190674051774050974050D0675050B0674050A0676050579050A084B050306740204000101
-  - Type:            CUSTOM
-    Name:            linking
-    Version:         2
-    SymbolTable:
-      - Index:           0
-        Kind:            FUNCTION
-        Name:            _Z4testii
-        Flags:           [ VISIBILITY_HIDDEN ]
-        Function:        0
-      - Index:           1
-        Kind:            GLOBAL
-        Name:            __stack_pointer
-        Flags:           [ UNDEFINED ]
-        Global:          0
-      - Index:           2
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         4
-      - Index:           3
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         6
-      - Index:           4
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         7
-  - Type:            CUSTOM
-    Name:            producers
-    Languages:
-      - Name:            C_plus_plus_14
-        Version:         ''
-    Tools:
-      - Name:            clang
-        Version:         '19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)'
-  - Type:            CUSTOM
-    Name:            target_features
-    Features:
-      - Prefix:          USED
-        Name:            mutable-globals
-      - Prefix:          USED
-        Name:            sign-ext
-...
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.s b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.s
new file mode 100644
index 00000000000000..af9875b1eee2a6
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.s
@@ -0,0 +1,488 @@
+	.text
+	.file	"pr-44884.cpp"
+	.globaltype	__stack_pointer, i32
+	.functype	_Z3barf (f32) -> (i32)
+	.functype	_Z3fooc (i32) -> (i32)
+	.section	.text._Z3barf,"",@
+	.hidden	_Z3barf                         # -- Begin function _Z3barf
+	.globl	_Z3barf
+	.type	_Z3barf, at function
+_Z3barf:                                # @_Z3barf
+.Lfunc_begin0:
+	.file	1 "/data/projects/scripts/regression-suite/input/general" "pr-44884.cpp"
+	.loc	1 1 0                           # pr-44884.cpp:1:0
+	.functype	_Z3barf (f32) -> (i32)
+	.local  	i32, i32, i32, f32, f32, f32, i32, i32, i32, i32, i32, i32
+# %bb.0:                                # %entry
+	global.get	__stack_pointer
+	local.set	1
+	i32.const	16
+	local.set	2
+	local.get	1
+	local.get	2
+	i32.sub 
+	local.set	3
+	local.get	3
+	local.get	0
+	f32.store	12
+.Ltmp0:
+	.loc	1 1 36 prologue_end             # pr-44884.cpp:1:36
+	local.get	3
+	f32.load	12
+	local.set	4
+	local.get	4
+	f32.abs 
+	local.set	5
+	f32.const	0x1p31
+	local.set	6
+	local.get	5
+	local.get	6
+	f32.lt  
+	local.set	7
+	local.get	7
+	i32.eqz
+	local.set	8
+	block   	
+	block   	
+	local.get	8
+	br_if   	0                               # 0: down to label1
+# %bb.1:                                # %entry
+	local.get	4
+	i32.trunc_f32_s
+	local.set	9
+	local.get	9
+	local.set	10
+	br      	1                               # 1: down to label0
+.LBB0_2:                                # %entry
+	.loc	1 0 36 is_stmt 0                # pr-44884.cpp:0:36
+	end_block                               # label1:
+	.loc	1 1 36                          # pr-44884.cpp:1:36
+	i32.const	-2147483648
+	local.set	11
+	local.get	11
+	local.set	10
+.LBB0_3:                                # %entry
+	.loc	1 0 36                          # pr-44884.cpp:0:36
+	end_block                               # label0:
+	.loc	1 1 36                          # pr-44884.cpp:1:36
+	local.get	10
+	local.set	12
+	.loc	1 1 24                          # pr-44884.cpp:1:24
+	local.get	12
+	return
+	end_function
+.Ltmp1:
+.Lfunc_end0:
+                                        # -- End function
+	.section	.text._Z3fooc,"",@
+	.hidden	_Z3fooc                         # -- Begin function _Z3fooc
+	.globl	_Z3fooc
+	.type	_Z3fooc, at function
+_Z3fooc:                                # @_Z3fooc
+.Lfunc_begin1:
+	.loc	1 3 0 is_stmt 1                 # pr-44884.cpp:3:0
+	.functype	_Z3fooc (i32) -> (i32)
+	.local  	i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, f32, f32, i32, i32, i32, i32, i32, i32, i32, i32, i32
+# %bb.0:                                # %entry
+	global.get	__stack_pointer
+	local.set	1
+	i32.const	16
+	local.set	2
+	local.get	1
+	local.get	2
+	i32.sub 
+	local.set	3
+	local.get	3
+	global.set	__stack_pointer
+	local.get	3
+	local.get	0
+	i32.store8	15
+.Ltmp2:
+	.loc	1 5 15 prologue_end             # pr-44884.cpp:5:15
+	local.get	3
+	i32.load8_u	15
+	local.set	4
+	i32.const	24
+	local.set	5
+	local.get	4
+	local.get	5
+	i32.shl 
+	local.set	6
+	local.get	6
+	local.get	5
+	i32.shr_s
+	local.set	7
+	.loc	1 5 7 is_stmt 0                 # pr-44884.cpp:5:7
+	local.get	3
+	local.get	7
+	i32.store	8
+.Ltmp3:
+	.loc	1 9 21 is_stmt 1                # pr-44884.cpp:9:21
+	local.get	3
+	i32.load	8
+	local.set	8
+	.loc	1 9 29 is_stmt 0                # pr-44884.cpp:9:29
+	local.get	3
+	i32.load8_u	15
+	local.set	9
+	i32.const	24
+	local.set	10
+	local.get	9
+	local.get	10
+	i32.shl 
+	local.set	11
+	local.get	11
+	local.get	10
+	i32.shr_s
+	local.set	12
+	.loc	1 9 27                          # pr-44884.cpp:9:27
+	local.get	8
+	local.get	12
+	i32.add 
+	local.set	13
+	.loc	1 9 21                          # pr-44884.cpp:9:21
+	local.get	13
+	f32.convert_i32_s
+	local.set	14
+	.loc	1 9 13                          # pr-44884.cpp:9:13
+	local.get	3
+	local.get	14
+	f32.store	4
+	.loc	1 10 19 is_stmt 1               # pr-44884.cpp:10:19
+	local.get	3
+	f32.load	4
+	local.set	15
+	.loc	1 10 15 is_stmt 0               # pr-44884.cpp:10:15
+	local.get	15
+	call	_Z3barf
+	local.set	16
+	.loc	1 10 13                         # pr-44884.cpp:10:13
+	local.get	3
+	local.get	16
+	i32.store	8
+.Ltmp4:
+	.loc	1 13 10 is_stmt 1               # pr-44884.cpp:13:10
+	local.get	3
+	i32.load	8
+	local.set	17
+	.loc	1 13 18 is_stmt 0               # pr-44884.cpp:13:18
+	local.get	3
+	i32.load8_u	15
+	local.set	18
+	i32.const	24
+	local.set	19
+	local.get	18
+	local.get	19
+	i32.shl 
+	local.set	20
+	local.get	20
+	local.get	19
+	i32.shr_s
+	local.set	21
+	.loc	1 13 16                         # pr-44884.cpp:13:16
+	local.get	17
+	local.get	21
+	i32.add 
+	local.set	22
+	.loc	1 13 3                          # pr-44884.cpp:13:3
+	i32.const	16
+	local.set	23
+	local.get	3
+	local.get	23
+	i32.add 
+	local.set	24
+	local.get	24
+	global.set	__stack_pointer
+	local.get	22
+	return
+	end_function
+.Ltmp5:
+.Lfunc_end1:
+                                        # -- End function
+	.section	.debug_abbrev,"",@
+	.int8	1                               # Abbreviation Code
+	.int8	17                              # DW_TAG_compile_unit
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	37                              # DW_AT_producer
+	.int8	14                              # DW_FORM_strp
+	.int8	19                              # DW_AT_language
+	.int8	5                               # DW_FORM_data2
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	16                              # DW_AT_stmt_list
+	.int8	23                              # DW_FORM_sec_offset
+	.int8	27                              # DW_AT_comp_dir
+	.int8	14                              # DW_FORM_strp
+	.int8	17                              # DW_AT_low_pc
+	.int8	1                               # DW_FORM_addr
+	.int8	85                              # DW_AT_ranges
+	.int8	23                              # DW_FORM_sec_offset
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	2                               # Abbreviation Code
+	.int8	36                              # DW_TAG_base_type
+	.int8	0                               # DW_CHILDREN_no
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	62                              # DW_AT_encoding
+	.int8	11                              # DW_FORM_data1
+	.int8	11                              # DW_AT_byte_size
+	.int8	11                              # DW_FORM_data1
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	3                               # Abbreviation Code
+	.int8	46                              # DW_TAG_subprogram
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	17                              # DW_AT_low_pc
+	.int8	1                               # DW_FORM_addr
+	.int8	18                              # DW_AT_high_pc
+	.int8	6                               # DW_FORM_data4
+	.int8	64                              # DW_AT_frame_base
+	.int8	24                              # DW_FORM_exprloc
+	.int8	110                             # DW_AT_linkage_name
+	.int8	14                              # DW_FORM_strp
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	63                              # DW_AT_external
+	.int8	25                              # DW_FORM_flag_present
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	4                               # Abbreviation Code
+	.int8	5                               # DW_TAG_formal_parameter
+	.int8	0                               # DW_CHILDREN_no
+	.int8	2                               # DW_AT_location
+	.int8	24                              # DW_FORM_exprloc
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	5                               # Abbreviation Code
+	.int8	52                              # DW_TAG_variable
+	.int8	0                               # DW_CHILDREN_no
+	.int8	2                               # DW_AT_location
+	.int8	24                              # DW_FORM_exprloc
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	6                               # Abbreviation Code
+	.int8	11                              # DW_TAG_lexical_block
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	17                              # DW_AT_low_pc
+	.int8	1                               # DW_FORM_addr
+	.int8	18                              # DW_AT_high_pc
+	.int8	6                               # DW_FORM_data4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	7                               # Abbreviation Code
+	.int8	22                              # DW_TAG_typedef
+	.int8	0                               # DW_CHILDREN_no
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	0                               # EOM(3)
+	.section	.debug_info,"",@
+.Lcu_begin0:
+	.int32	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
+.Ldebug_info_start0:
+	.int16	4                               # DWARF version number
+	.int32	.debug_abbrev0                  # Offset Into Abbrev. Section
+	.int8	4                               # Address Size (in bytes)
+	.int8	1                               # Abbrev [1] 0xb:0xca DW_TAG_compile_unit
+	.int32	.Linfo_string0                  # DW_AT_producer
+	.int16	33                              # DW_AT_language
+	.int32	.Linfo_string1                  # DW_AT_name
+	.int32	.Lline_table_start0             # DW_AT_stmt_list
+	.int32	.Linfo_string2                  # DW_AT_comp_dir
+	.int32	0                               # DW_AT_low_pc
+	.int32	.Ldebug_ranges0                 # DW_AT_ranges
+	.int8	2                               # Abbrev [2] 0x26:0x7 DW_TAG_base_type
+	.int32	.Linfo_string3                  # DW_AT_name
+	.int8	5                               # DW_AT_encoding
+	.int8	4                               # DW_AT_byte_size
+	.int8	3                               # Abbrev [3] 0x2d:0x2b DW_TAG_subprogram
+	.int32	.Lfunc_begin0                   # DW_AT_low_pc
+	.int32	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
+	.int8	4                               # DW_AT_frame_base
+	.int8	237
+	.int8	0
+	.int8	3
+	.int8	159
+	.int32	.Linfo_string4                  # DW_AT_linkage_name
+	.int32	.Linfo_string5                  # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	1                               # DW_AT_decl_line
+	.int32	38                              # DW_AT_type
+                                        # DW_AT_external
+	.int8	4                               # Abbrev [4] 0x49:0xe DW_TAG_formal_parameter
+	.int8	2                               # DW_AT_location
+	.int8	145
+	.int8	12
+	.int32	.Linfo_string9                  # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	1                               # DW_AT_decl_line
+	.int32	198                             # DW_AT_type
+	.int8	0                               # End Of Children Mark
+	.int8	3                               # Abbrev [3] 0x58:0x67 DW_TAG_subprogram
+	.int32	.Lfunc_begin1                   # DW_AT_low_pc
+	.int32	.Lfunc_end1-.Lfunc_begin1       # DW_AT_high_pc
+	.int8	4                               # DW_AT_frame_base
+	.int8	237
+	.int8	0
+	.int8	3
+	.int8	159
+	.int32	.Linfo_string6                  # DW_AT_linkage_name
+	.int32	.Linfo_string7                  # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	3                               # DW_AT_decl_line
+	.int32	191                             # DW_AT_type
+                                        # DW_AT_external
+	.int8	4                               # Abbrev [4] 0x74:0xe DW_TAG_formal_parameter
+	.int8	2                               # DW_AT_location
+	.int8	145
+	.int8	15
+	.int32	.Linfo_string11                 # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	3                               # DW_AT_decl_line
+	.int32	205                             # DW_AT_type
+	.int8	5                               # Abbrev [5] 0x82:0xe DW_TAG_variable
+	.int8	2                               # DW_AT_location
+	.int8	145
+	.int8	8
+	.int32	.Linfo_string13                 # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	5                               # DW_AT_decl_line
+	.int32	168                             # DW_AT_type
+	.int8	6                               # Abbrev [6] 0x90:0x18 DW_TAG_lexical_block
+	.int32	.Ltmp3                          # DW_AT_low_pc
+	.int32	.Ltmp4-.Ltmp3                   # DW_AT_high_pc
+	.int8	5                               # Abbrev [5] 0x99:0xe DW_TAG_variable
+	.int8	2                               # DW_AT_location
+	.int8	145
+	.int8	4
+	.int32	.Linfo_string15                 # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	9                               # DW_AT_decl_line
+	.int32	179                             # DW_AT_type
+	.int8	0                               # End Of Children Mark
+	.int8	7                               # Abbrev [7] 0xa8:0xb DW_TAG_typedef
+	.int32	38                              # DW_AT_type
+	.int32	.Linfo_string14                 # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	4                               # DW_AT_decl_line
+	.int8	7                               # Abbrev [7] 0xb3:0xb DW_TAG_typedef
+	.int32	198                             # DW_AT_type
+	.int32	.Linfo_string16                 # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	7                               # DW_AT_decl_line
+	.int8	0                               # End Of Children Mark
+	.int8	2                               # Abbrev [2] 0xbf:0x7 DW_TAG_base_type
+	.int32	.Linfo_string8                  # DW_AT_name
+	.int8	7                               # DW_AT_encoding
+	.int8	4                               # DW_AT_byte_size
+	.int8	2                               # Abbrev [2] 0xc6:0x7 DW_TAG_base_type
+	.int32	.Linfo_string10                 # DW_AT_name
+	.int8	4                               # DW_AT_encoding
+	.int8	4                               # DW_AT_byte_size
+	.int8	2                               # Abbrev [2] 0xcd:0x7 DW_TAG_base_type
+	.int32	.Linfo_string12                 # DW_AT_name
+	.int8	6                               # DW_AT_encoding
+	.int8	1                               # DW_AT_byte_size
+	.int8	0                               # End Of Children Mark
+.Ldebug_info_end0:
+	.section	.debug_ranges,"",@
+.Ldebug_ranges0:
+	.int32	.Lfunc_begin0
+	.int32	.Lfunc_end0
+	.int32	.Lfunc_begin1
+	.int32	.Lfunc_end1
+	.int32	0
+	.int32	0
+	.section	.debug_str,"S",@
+.Linfo_string0:
+	.asciz	"clang version 19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)" # string offset=0
+.Linfo_string1:
+	.asciz	"pr-44884.cpp"                  # string offset=111
+.Linfo_string2:
+	.asciz	"/data/projects/scripts/regression-suite/input/general" # string offset=124
+.Linfo_string3:
+	.asciz	"int"                           # string offset=178
+.Linfo_string4:
+	.asciz	"_Z3barf"                       # string offset=182
+.Linfo_string5:
+	.asciz	"bar"                           # string offset=190
+.Linfo_string6:
+	.asciz	"_Z3fooc"                       # string offset=194
+.Linfo_string7:
+	.asciz	"foo"                           # string offset=202
+.Linfo_string8:
+	.asciz	"unsigned int"                  # string offset=206
+.Linfo_string9:
+	.asciz	"Input"                         # string offset=219
+.Linfo_string10:
+	.asciz	"float"                         # string offset=225
+.Linfo_string11:
+	.asciz	"Param"                         # string offset=231
+.Linfo_string12:
+	.asciz	"char"                          # string offset=237
+.Linfo_string13:
+	.asciz	"Value"                         # string offset=242
+.Linfo_string14:
+	.asciz	"INT"                           # string offset=248
+.Linfo_string15:
+	.asciz	"Added"                         # string offset=252
+.Linfo_string16:
+	.asciz	"FLOAT"                         # string offset=258
+	.ident	"clang version 19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)"
+	.section	.custom_section.producers,"",@
+	.int8	2
+	.int8	8
+	.ascii	"language"
+	.int8	1
+	.int8	14
+	.ascii	"C_plus_plus_14"
+	.int8	0
+	.int8	12
+	.ascii	"processed-by"
+	.int8	1
+	.int8	5
+	.ascii	"clang"
+	.int8	96
+	.ascii	"19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)"
+	.section	.debug_str,"S",@
+	.section	.custom_section.target_features,"",@
+	.int8	2
+	.int8	43
+	.int8	15
+	.ascii	"mutable-globals"
+	.int8	43
+	.int8	8
+	.ascii	"sign-ext"
+	.section	.debug_str,"S",@
+	.section	.debug_line,"",@
+.Lline_table_start0:
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.yaml b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.yaml
deleted file mode 100644
index 4ca82d549f0959..00000000000000
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-44884-clang.yaml
+++ /dev/null
@@ -1,241 +0,0 @@
---- !WASM
-FileHeader:
-  Version:         0x1
-Sections:
-  - Type:            TYPE
-    Signatures:
-      - Index:           0
-        ParamTypes:
-          - F32
-        ReturnTypes:
-          - I32
-      - Index:           1
-        ParamTypes:
-          - I32
-        ReturnTypes:
-          - I32
-  - Type:            IMPORT
-    Imports:
-      - Module:          env
-        Field:           __linear_memory
-        Kind:            MEMORY
-        Memory:
-          Minimum:         0x0
-      - Module:          env
-        Field:           __stack_pointer
-        Kind:            GLOBAL
-        GlobalType:      I32
-        GlobalMutable:   true
-  - Type:            FUNCTION
-    FunctionTypes:   [ 0, 1 ]
-  - Type:            CODE
-    Relocations:
-      - Type:            R_WASM_GLOBAL_INDEX_LEB
-        Index:           1
-        Offset:          0xA
-      - Type:            R_WASM_GLOBAL_INDEX_LEB
-        Index:           1
-        Offset:          0x75
-      - Type:            R_WASM_GLOBAL_INDEX_LEB
-        Index:           1
-        Offset:          0x8A
-      - Type:            R_WASM_FUNCTION_INDEX_LEB
-        Index:           0
-        Offset:          0xF3
-      - Type:            R_WASM_GLOBAL_INDEX_LEB
-        Index:           1
-        Offset:          0x136
-    Functions:
-      - Index:           0
-        Locals:
-          - Type:            I32
-            Count:           3
-          - Type:            F32
-            Count:           3
-          - Type:            I32
-            Count:           6
-        Body:            238080808000210141102102200120026B21032003200038020C20032A020C210420048B2105430000004F2106200520065D210720074521080240024020080D002004A821092009210A0C010B418080808078210B200B210A0B200A210C200C0F0B
-      - Index:           1
-        Locals:
-          - Type:            I32
-            Count:           13
-          - Type:            F32
-            Count:           2
-          - Type:            I32
-            Count:           9
-        Body:            238080808000210141102102200120026B21032003248080808000200320003A000F20032D000F2104411821052004200574210620062005752107200320073602082003280208210820032D000F21094118210A2009200A74210B200B200A75210C2008200C6A210D200DB2210E2003200E38020420032A0204210F200F1080808080002110200320103602082003280208211120032D000F2112411821132012201374211420142013752115201120156A211641102117200320176A2118201824808080800020160F0B
-  - Type:            CUSTOM
-    Name:            .debug_abbrev
-    Payload:         011101250E1305030E10171B0E110155170000022400030E3E0B0B0B0000032E011101120640186E0E030E3A0B3B0B49133F1900000405000218030E3A0B3B0B491300000534000218030E3A0B3B0B49130000060B011101120600000716004913030E3A0B3B0B000000
-  - Type:            CUSTOM
-    Relocations:
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x6
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0xC
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0x12
-        Addend:          111
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           6
-        Offset:          0x16
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0x1A
-        Addend:          124
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           4
-        Offset:          0x22
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0x27
-        Addend:          178
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x2E
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0x3B
-        Addend:          182
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0x3F
-        Addend:          190
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0x4D
-        Addend:          219
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           2
-        Offset:          0x59
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0x66
-        Addend:          194
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0x6A
-        Addend:          202
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0x78
-        Addend:          231
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0x86
-        Addend:          242
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           2
-        Offset:          0x91
-        Addend:          73
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0x9D
-        Addend:          252
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0xAD
-        Addend:          248
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0xB8
-        Addend:          258
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0xC0
-        Addend:          206
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0xC7
-        Addend:          225
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0xCE
-        Addend:          237
-    Name:            .debug_info
-    Payload:         D100000004000000000004010000000021006F000000000000007C000000000000000000000002B2000000050403020000006900000004ED00039FB6000000BE0000000101260000000402910CDB0000000101C600000000036D000000D200000004ED00039FC2000000CA0000000103BF0000000402910FE70000000103CD00000005029108F20000000105A800000006B60000004B00000005029104FC0000000109B3000000000726000000F8000000010407C60000000201000001070002CE000000070402E1000000040402ED000000060100
-  - Type:            CUSTOM
-    Relocations:
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x0
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x4
-        Addend:          105
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           2
-        Offset:          0x8
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           2
-        Offset:          0xC
-        Addend:          210
-    Name:            .debug_ranges
-    Payload:         020000006B0000006D0000003F0100000000000000000000
-  - Type:            CUSTOM
-    Name:            .debug_str
-    Payload:         636C616E672076657273696F6E2031392E302E3067697420282F646174612F70726F6A656374732F6C6C766D2D726F6F742F6C6C766D2D70726F6A6563742F636C616E672032646236373033663063323537643239336466343535653264666638633166623639356334313030290070722D34343838342E637070002F646174612F70726F6A656374732F736372697074732F72656772657373696F6E2D73756974652F696E7075742F67656E6572616C00696E74005F5A336261726600626172005F5A33666F6F6300666F6F00756E7369676E656420696E7400496E70757400666C6F617400506172616D00636861720056616C756500494E5400416464656400464C4F415400
-  - Type:            CUSTOM
-    Relocations:
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x31
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           2
-        Offset:          0x4D
-    Name:            .debug_line
-    Payload:         8A000000040024000000010101FB0E0D0001010101000000010000010070722D34343838342E6370700000000000000502020000000105240A08F20602321121B92105184A02040001010005026D00000014050F0A022914050706088205150678051D0674051B0882051574050D5805130675050F0674050D9E050A067705120674051008820503740217000101
-  - Type:            CUSTOM
-    Name:            linking
-    Version:         2
-    SymbolTable:
-      - Index:           0
-        Kind:            FUNCTION
-        Name:            _Z3barf
-        Flags:           [ VISIBILITY_HIDDEN ]
-        Function:        0
-      - Index:           1
-        Kind:            GLOBAL
-        Name:            __stack_pointer
-        Flags:           [ UNDEFINED ]
-        Global:          0
-      - Index:           2
-        Kind:            FUNCTION
-        Name:            _Z3fooc
-        Flags:           [ VISIBILITY_HIDDEN ]
-        Function:        1
-      - Index:           3
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         4
-      - Index:           4
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         6
-      - Index:           5
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         7
-      - Index:           6
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         8
-  - Type:            CUSTOM
-    Name:            producers
-    Languages:
-      - Name:            C_plus_plus_14
-        Version:         ''
-    Tools:
-      - Name:            clang
-        Version:         '19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)'
-  - Type:            CUSTOM
-    Name:            target_features
-    Features:
-      - Prefix:          USED
-        Name:            mutable-globals
-      - Prefix:          USED
-        Name:            sign-ext
-...
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.s b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.s
new file mode 100644
index 00000000000000..1056db0760eae7
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.s
@@ -0,0 +1,259 @@
+	.text
+	.file	"pr-46466.cpp"
+	.file	1 "/data/projects/scripts/regression-suite/input/general" "pr-46466.cpp"
+	.functype	_Z4testv () -> (i32)
+	.section	.text._Z4testv,"",@
+	.hidden	_Z4testv                        # -- Begin function _Z4testv
+	.globl	_Z4testv
+	.type	_Z4testv, at function
+_Z4testv:                               # @_Z4testv
+.Lfunc_begin0:
+	.functype	_Z4testv () -> (i32)
+	.local  	i32
+# %bb.0:                                # %entry
+	.loc	1 10 3 prologue_end             # pr-46466.cpp:10:3
+	i32.const	1
+	local.set	0
+	local.get	0
+	return
+	end_function
+.Ltmp0:
+.Lfunc_end0:
+                                        # -- End function
+	.hidden	S                               # @S
+	.type	S, at object
+	.section	.bss.S,"",@
+	.globl	S
+S:
+	.skip	1
+	.size	S, 1
+
+	.section	.debug_abbrev,"",@
+	.int8	1                               # Abbreviation Code
+	.int8	17                              # DW_TAG_compile_unit
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	37                              # DW_AT_producer
+	.int8	14                              # DW_FORM_strp
+	.int8	19                              # DW_AT_language
+	.int8	5                               # DW_FORM_data2
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	16                              # DW_AT_stmt_list
+	.int8	23                              # DW_FORM_sec_offset
+	.int8	27                              # DW_AT_comp_dir
+	.int8	14                              # DW_FORM_strp
+	.int8	17                              # DW_AT_low_pc
+	.int8	1                               # DW_FORM_addr
+	.int8	18                              # DW_AT_high_pc
+	.int8	6                               # DW_FORM_data4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	2                               # Abbreviation Code
+	.int8	52                              # DW_TAG_variable
+	.int8	0                               # DW_CHILDREN_no
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	63                              # DW_AT_external
+	.int8	25                              # DW_FORM_flag_present
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	2                               # DW_AT_location
+	.int8	24                              # DW_FORM_exprloc
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	3                               # Abbreviation Code
+	.int8	19                              # DW_TAG_structure_type
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	54                              # DW_AT_calling_convention
+	.int8	11                              # DW_FORM_data1
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	11                              # DW_AT_byte_size
+	.int8	11                              # DW_FORM_data1
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	4                               # Abbreviation Code
+	.int8	13                              # DW_TAG_member
+	.int8	0                               # DW_CHILDREN_no
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	56                              # DW_AT_data_member_location
+	.int8	11                              # DW_FORM_data1
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	5                               # Abbreviation Code
+	.int8	23                              # DW_TAG_union_type
+	.int8	0                               # DW_CHILDREN_no
+	.int8	54                              # DW_AT_calling_convention
+	.int8	11                              # DW_FORM_data1
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	11                              # DW_AT_byte_size
+	.int8	11                              # DW_FORM_data1
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	6                               # Abbreviation Code
+	.int8	46                              # DW_TAG_subprogram
+	.int8	0                               # DW_CHILDREN_no
+	.int8	17                              # DW_AT_low_pc
+	.int8	1                               # DW_FORM_addr
+	.int8	18                              # DW_AT_high_pc
+	.int8	6                               # DW_FORM_data4
+	.int8	64                              # DW_AT_frame_base
+	.int8	24                              # DW_FORM_exprloc
+	.int8	110                             # DW_AT_linkage_name
+	.int8	14                              # DW_FORM_strp
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	63                              # DW_AT_external
+	.int8	25                              # DW_FORM_flag_present
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	7                               # Abbreviation Code
+	.int8	36                              # DW_TAG_base_type
+	.int8	0                               # DW_CHILDREN_no
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	62                              # DW_AT_encoding
+	.int8	11                              # DW_FORM_data1
+	.int8	11                              # DW_AT_byte_size
+	.int8	11                              # DW_FORM_data1
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	0                               # EOM(3)
+	.section	.debug_info,"",@
+.Lcu_begin0:
+	.int32	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
+.Ldebug_info_start0:
+	.int16	4                               # DWARF version number
+	.int32	.debug_abbrev0                  # Offset Into Abbrev. Section
+	.int8	4                               # Address Size (in bytes)
+	.int8	1                               # Abbrev [1] 0xb:0x72 DW_TAG_compile_unit
+	.int32	.Linfo_string0                  # DW_AT_producer
+	.int16	33                              # DW_AT_language
+	.int32	.Linfo_string1                  # DW_AT_name
+	.int32	.Lline_table_start0             # DW_AT_stmt_list
+	.int32	.Linfo_string2                  # DW_AT_comp_dir
+	.int32	.Lfunc_begin0                   # DW_AT_low_pc
+	.int32	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
+	.int8	2                               # Abbrev [2] 0x26:0x11 DW_TAG_variable
+	.int32	.Linfo_string3                  # DW_AT_name
+	.int32	55                              # DW_AT_type
+                                        # DW_AT_external
+	.int8	1                               # DW_AT_decl_file
+	.int8	8                               # DW_AT_decl_line
+	.int8	5                               # DW_AT_location
+	.int8	3
+	.int32	S
+	.int8	3                               # Abbrev [3] 0x37:0x1f DW_TAG_structure_type
+	.int8	5                               # DW_AT_calling_convention
+	.int32	.Linfo_string6                  # DW_AT_name
+	.int8	1                               # DW_AT_byte_size
+	.int8	1                               # DW_AT_decl_file
+	.int8	1                               # DW_AT_decl_line
+	.int8	4                               # Abbrev [4] 0x40:0xc DW_TAG_member
+	.int32	.Linfo_string4                  # DW_AT_name
+	.int32	76                              # DW_AT_type
+	.int8	1                               # DW_AT_decl_file
+	.int8	5                               # DW_AT_decl_line
+	.int8	0                               # DW_AT_data_member_location
+	.int8	5                               # Abbrev [5] 0x4c:0x9 DW_TAG_union_type
+	.int8	5                               # DW_AT_calling_convention
+	.int32	.Linfo_string5                  # DW_AT_name
+	.int8	1                               # DW_AT_byte_size
+	.int8	1                               # DW_AT_decl_file
+	.int8	2                               # DW_AT_decl_line
+	.int8	0                               # End Of Children Mark
+	.int8	6                               # Abbrev [6] 0x56:0x1f DW_TAG_subprogram
+	.int32	.Lfunc_begin0                   # DW_AT_low_pc
+	.int32	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
+	.int8	7                               # DW_AT_frame_base
+	.int8	237
+	.int8	3
+	.int32	__stack_pointer
+	.int8	159
+	.int32	.Linfo_string7                  # DW_AT_linkage_name
+	.int32	.Linfo_string8                  # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	9                               # DW_AT_decl_line
+	.int32	117                             # DW_AT_type
+                                        # DW_AT_external
+	.int8	7                               # Abbrev [7] 0x75:0x7 DW_TAG_base_type
+	.int32	.Linfo_string9                  # DW_AT_name
+	.int8	5                               # DW_AT_encoding
+	.int8	4                               # DW_AT_byte_size
+	.int8	0                               # End Of Children Mark
+.Ldebug_info_end0:
+	.section	.debug_str,"S",@
+.Linfo_string0:
+	.asciz	"clang version 19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)" # string offset=0
+.Linfo_string1:
+	.asciz	"pr-46466.cpp"                  # string offset=111
+.Linfo_string2:
+	.asciz	"/data/projects/scripts/regression-suite/input/general" # string offset=124
+.Linfo_string3:
+	.asciz	"S"                             # string offset=178
+.Linfo_string4:
+	.asciz	"U"                             # string offset=180
+.Linfo_string5:
+	.asciz	"Union"                         # string offset=182
+.Linfo_string6:
+	.asciz	"Struct"                        # string offset=188
+.Linfo_string7:
+	.asciz	"_Z4testv"                      # string offset=195
+.Linfo_string8:
+	.asciz	"test"                          # string offset=204
+.Linfo_string9:
+	.asciz	"int"                           # string offset=209
+	.ident	"clang version 19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)"
+	.section	.custom_section.producers,"",@
+	.int8	2
+	.int8	8
+	.ascii	"language"
+	.int8	1
+	.int8	14
+	.ascii	"C_plus_plus_14"
+	.int8	0
+	.int8	12
+	.ascii	"processed-by"
+	.int8	1
+	.int8	5
+	.ascii	"clang"
+	.int8	96
+	.ascii	"19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)"
+	.section	.debug_str,"S",@
+	.section	.custom_section.target_features,"",@
+	.int8	2
+	.int8	43
+	.int8	15
+	.ascii	"mutable-globals"
+	.int8	43
+	.int8	8
+	.ascii	"sign-ext"
+	.section	.debug_str,"S",@
+	.section	.debug_line,"",@
+.Lline_table_start0:
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.yaml b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.yaml
deleted file mode 100644
index 5afc9fbd638811..00000000000000
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/pr-46466-clang.yaml
+++ /dev/null
@@ -1,169 +0,0 @@
---- !WASM
-FileHeader:
-  Version:         0x1
-Sections:
-  - Type:            TYPE
-    Signatures:
-      - Index:           0
-        ParamTypes:      []
-        ReturnTypes:
-          - I32
-  - Type:            IMPORT
-    Imports:
-      - Module:          env
-        Field:           __linear_memory
-        Kind:            MEMORY
-        Memory:
-          Minimum:         0x1
-      - Module:          env
-        Field:           __stack_pointer
-        Kind:            GLOBAL
-        GlobalType:      I32
-        GlobalMutable:   true
-  - Type:            FUNCTION
-    FunctionTypes:   [ 0 ]
-  - Type:            DATACOUNT
-    Count:           1
-  - Type:            CODE
-    Functions:
-      - Index:           0
-        Locals:
-          - Type:            I32
-            Count:           1
-        Body:            4101210020000F0B
-  - Type:            DATA
-    Segments:
-      - SectionOffset:   6
-        InitFlags:       0
-        Offset:
-          Opcode:          I32_CONST
-          Value:           0
-        Content:         '00'
-  - Type:            CUSTOM
-    Name:            .debug_abbrev
-    Payload:         011101250E1305030E10171B0E110112060000023400030E49133F193A0B3B0B02180000031301360B030E0B0B3A0B3B0B0000040D00030E49133A0B3B0B380B0000051700360B030E0B0B3A0B3B0B0000062E001101120640186E0E030E3A0B3B0B49133F190000072400030E3E0B0B0B000000
-  - Type:            CUSTOM
-    Relocations:
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           2
-        Offset:          0x6
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           4
-        Offset:          0xC
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           4
-        Offset:          0x12
-        Addend:          111
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           5
-        Offset:          0x16
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           4
-        Offset:          0x1A
-        Addend:          124
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x1E
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           4
-        Offset:          0x27
-        Addend:          178
-      - Type:            R_WASM_MEMORY_ADDR_I32
-        Index:           1
-        Offset:          0x33
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           4
-        Offset:          0x39
-        Addend:          188
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           4
-        Offset:          0x41
-        Addend:          180
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           4
-        Offset:          0x4E
-        Addend:          182
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x57
-      - Type:            R_WASM_GLOBAL_INDEX_I32
-        Index:           3
-        Offset:          0x62
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           4
-        Offset:          0x67
-        Addend:          195
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           4
-        Offset:          0x6B
-        Addend:          204
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           4
-        Offset:          0x76
-        Addend:          209
-    Name:            .debug_info
-    Payload:         7900000004000000000004010000000021006F000000000000007C000000020000000B00000002B20000003700000001080503000000000305BC00000001010104B40000004C0000000105000505B60000000101020006020000000B00000007ED03000000009FC3000000CC00000001097500000007D1000000050400
-  - Type:            CUSTOM
-    Name:            .debug_str
-    Payload:         636C616E672076657273696F6E2031392E302E3067697420282F646174612F70726F6A656374732F6C6C766D2D726F6F742F6C6C766D2D70726F6A6563742F636C616E672032646236373033663063323537643239336466343535653264666638633166623639356334313030290070722D34363436362E637070002F646174612F70726F6A656374732F736372697074732F72656772657373696F6E2D73756974652F696E7075742F67656E6572616C0053005500556E696F6E00537472756374005F5A347465737476007465737400696E7400
-  - Type:            CUSTOM
-    Relocations:
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x34
-        Addend:          3
-    Name:            .debug_line
-    Payload:         3C000000040024000000010101FB0E0D0001010101000000010000010070722D34363436362E637070000000000005030A000502050000000309010208000101
-  - Type:            CUSTOM
-    Name:            linking
-    Version:         2
-    SymbolTable:
-      - Index:           0
-        Kind:            FUNCTION
-        Name:            _Z4testv
-        Flags:           [ VISIBILITY_HIDDEN ]
-        Function:        0
-      - Index:           1
-        Kind:            DATA
-        Name:            S
-        Flags:           [ VISIBILITY_HIDDEN ]
-        Segment:         0
-        Size:            1
-      - Index:           2
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         6
-      - Index:           3
-        Kind:            GLOBAL
-        Name:            __stack_pointer
-        Flags:           [ UNDEFINED ]
-        Global:          0
-      - Index:           4
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         8
-      - Index:           5
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         9
-    SegmentInfo:
-      - Index:           0
-        Name:            .bss.S
-        Alignment:       0
-        Flags:           [  ]
-  - Type:            CUSTOM
-    Name:            producers
-    Languages:
-      - Name:            C_plus_plus_14
-        Version:         ''
-    Tools:
-      - Name:            clang
-        Version:         '19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)'
-  - Type:            CUSTOM
-    Name:            target_features
-    Features:
-      - Prefix:          USED
-        Name:            mutable-globals
-      - Prefix:          USED
-        Name:            sign-ext
-...
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.s b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.s
new file mode 100644
index 00000000000000..02afaf70d0ea8e
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.s
@@ -0,0 +1,366 @@
+	.text
+	.file	"test.cpp"
+	.globaltype	__stack_pointer, i32
+	.functype	_Z3fooPKijb (i32, i32, i32) -> (i32)
+	.section	.text._Z3fooPKijb,"",@
+	.hidden	_Z3fooPKijb                     # -- Begin function _Z3fooPKijb
+	.globl	_Z3fooPKijb
+	.type	_Z3fooPKijb, at function
+_Z3fooPKijb:                            # @_Z3fooPKijb
+.Lfunc_begin0:
+	.file	1 "/data/projects/scripts/regression-suite/input/general" "test.cpp"
+	.loc	1 2 0                           # test.cpp:2:0
+	.functype	_Z3fooPKijb (i32, i32, i32) -> (i32)
+	.local  	i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32
+# %bb.0:                                # %entry
+	global.get	__stack_pointer
+	local.set	3
+	i32.const	32
+	local.set	4
+	local.get	3
+	local.get	4
+	i32.sub 
+	local.set	5
+	local.get	5
+	local.get	0
+	i32.store	24
+	local.get	5
+	local.get	1
+	i32.store	20
+	local.get	2
+	local.set	6
+	local.get	5
+	local.get	6
+	i32.store8	19
+.Ltmp0:
+	.loc	1 3 7 prologue_end              # test.cpp:3:7
+	local.get	5
+	i32.load8_u	19
+	local.set	7
+.Ltmp1:
+	.loc	1 3 7 is_stmt 0                 # test.cpp:3:7
+	i32.const	1
+	local.set	8
+	local.get	7
+	local.get	8
+	i32.and 
+	local.set	9
+	block   	
+	block   	
+	local.get	9
+	i32.eqz
+	br_if   	0                               # 0: down to label1
+# %bb.1:                                # %if.then
+.Ltmp2:
+	.loc	1 5 19 is_stmt 1                # test.cpp:5:19
+	i32.const	7
+	local.set	10
+	local.get	5
+	local.get	10
+	i32.store	12
+	.loc	1 6 5                           # test.cpp:6:5
+	i32.const	7
+	local.set	11
+	local.get	5
+	local.get	11
+	i32.store	28
+	br      	1                               # 1: down to label0
+.Ltmp3:
+.LBB0_2:                                # %if.end
+	.loc	1 0 5 is_stmt 0                 # test.cpp:0:5
+	end_block                               # label1:
+	.loc	1 8 10 is_stmt 1                # test.cpp:8:10
+	local.get	5
+	i32.load	20
+	local.set	12
+	.loc	1 8 3 is_stmt 0                 # test.cpp:8:3
+	local.get	5
+	local.get	12
+	i32.store	28
+.LBB0_3:                                # %return
+	.loc	1 0 3                           # test.cpp:0:3
+	end_block                               # label0:
+	.loc	1 9 1 is_stmt 1                 # test.cpp:9:1
+	local.get	5
+	i32.load	28
+	local.set	13
+	local.get	13
+	return
+	end_function
+.Ltmp4:
+.Lfunc_end0:
+                                        # -- End function
+	.section	.debug_abbrev,"",@
+	.int8	1                               # Abbreviation Code
+	.int8	17                              # DW_TAG_compile_unit
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	37                              # DW_AT_producer
+	.int8	14                              # DW_FORM_strp
+	.int8	19                              # DW_AT_language
+	.int8	5                               # DW_FORM_data2
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	16                              # DW_AT_stmt_list
+	.int8	23                              # DW_FORM_sec_offset
+	.int8	27                              # DW_AT_comp_dir
+	.int8	14                              # DW_FORM_strp
+	.int8	17                              # DW_AT_low_pc
+	.int8	1                               # DW_FORM_addr
+	.int8	18                              # DW_AT_high_pc
+	.int8	6                               # DW_FORM_data4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	2                               # Abbreviation Code
+	.int8	46                              # DW_TAG_subprogram
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	17                              # DW_AT_low_pc
+	.int8	1                               # DW_FORM_addr
+	.int8	18                              # DW_AT_high_pc
+	.int8	6                               # DW_FORM_data4
+	.int8	64                              # DW_AT_frame_base
+	.int8	24                              # DW_FORM_exprloc
+	.int8	110                             # DW_AT_linkage_name
+	.int8	14                              # DW_FORM_strp
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	63                              # DW_AT_external
+	.int8	25                              # DW_FORM_flag_present
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	3                               # Abbreviation Code
+	.int8	5                               # DW_TAG_formal_parameter
+	.int8	0                               # DW_CHILDREN_no
+	.int8	2                               # DW_AT_location
+	.int8	24                              # DW_FORM_exprloc
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	4                               # Abbreviation Code
+	.int8	11                              # DW_TAG_lexical_block
+	.int8	1                               # DW_CHILDREN_yes
+	.int8	17                              # DW_AT_low_pc
+	.int8	1                               # DW_FORM_addr
+	.int8	18                              # DW_AT_high_pc
+	.int8	6                               # DW_FORM_data4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	5                               # Abbreviation Code
+	.int8	52                              # DW_TAG_variable
+	.int8	0                               # DW_CHILDREN_no
+	.int8	2                               # DW_AT_location
+	.int8	24                              # DW_FORM_exprloc
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	6                               # Abbreviation Code
+	.int8	22                              # DW_TAG_typedef
+	.int8	0                               # DW_CHILDREN_no
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	58                              # DW_AT_decl_file
+	.int8	11                              # DW_FORM_data1
+	.int8	59                              # DW_AT_decl_line
+	.int8	11                              # DW_FORM_data1
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	7                               # Abbreviation Code
+	.int8	36                              # DW_TAG_base_type
+	.int8	0                               # DW_CHILDREN_no
+	.int8	3                               # DW_AT_name
+	.int8	14                              # DW_FORM_strp
+	.int8	62                              # DW_AT_encoding
+	.int8	11                              # DW_FORM_data1
+	.int8	11                              # DW_AT_byte_size
+	.int8	11                              # DW_FORM_data1
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	8                               # Abbreviation Code
+	.int8	15                              # DW_TAG_pointer_type
+	.int8	0                               # DW_CHILDREN_no
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	9                               # Abbreviation Code
+	.int8	38                              # DW_TAG_const_type
+	.int8	0                               # DW_CHILDREN_no
+	.int8	73                              # DW_AT_type
+	.int8	19                              # DW_FORM_ref4
+	.int8	0                               # EOM(1)
+	.int8	0                               # EOM(2)
+	.int8	0                               # EOM(3)
+	.section	.debug_info,"",@
+.Lcu_begin0:
+	.int32	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
+.Ldebug_info_start0:
+	.int16	4                               # DWARF version number
+	.int32	.debug_abbrev0                  # Offset Into Abbrev. Section
+	.int8	4                               # Address Size (in bytes)
+	.int8	1                               # Abbrev [1] 0xb:0xb5 DW_TAG_compile_unit
+	.int32	.Linfo_string0                  # DW_AT_producer
+	.int16	33                              # DW_AT_language
+	.int32	.Linfo_string1                  # DW_AT_name
+	.int32	.Lline_table_start0             # DW_AT_stmt_list
+	.int32	.Linfo_string2                  # DW_AT_comp_dir
+	.int32	.Lfunc_begin0                   # DW_AT_low_pc
+	.int32	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
+	.int8	2                               # Abbrev [2] 0x26:0x6a DW_TAG_subprogram
+	.int32	.Lfunc_begin0                   # DW_AT_low_pc
+	.int32	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
+	.int8	4                               # DW_AT_frame_base
+	.int8	237
+	.int8	0
+	.int8	5
+	.int8	159
+	.int32	.Linfo_string3                  # DW_AT_linkage_name
+	.int32	.Linfo_string4                  # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	2                               # DW_AT_decl_line
+	.int32	144                             # DW_AT_type
+                                        # DW_AT_external
+	.int8	3                               # Abbrev [3] 0x42:0xe DW_TAG_formal_parameter
+	.int8	2                               # DW_AT_location
+	.int8	145
+	.int8	24
+	.int32	.Linfo_string6                  # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	2                               # DW_AT_decl_line
+	.int32	151                             # DW_AT_type
+	.int8	3                               # Abbrev [3] 0x50:0xe DW_TAG_formal_parameter
+	.int8	2                               # DW_AT_location
+	.int8	145
+	.int8	20
+	.int32	.Linfo_string8                  # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	2                               # DW_AT_decl_line
+	.int32	172                             # DW_AT_type
+	.int8	3                               # Abbrev [3] 0x5e:0xe DW_TAG_formal_parameter
+	.int8	2                               # DW_AT_location
+	.int8	145
+	.int8	19
+	.int32	.Linfo_string10                 # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	2                               # DW_AT_decl_line
+	.int32	179                             # DW_AT_type
+	.int8	4                               # Abbrev [4] 0x6c:0x18 DW_TAG_lexical_block
+	.int32	.Ltmp2                          # DW_AT_low_pc
+	.int32	.Ltmp3-.Ltmp2                   # DW_AT_high_pc
+	.int8	5                               # Abbrev [5] 0x75:0xe DW_TAG_variable
+	.int8	2                               # DW_AT_location
+	.int8	145
+	.int8	12
+	.int32	.Linfo_string12                 # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	5                               # DW_AT_decl_line
+	.int32	186                             # DW_AT_type
+	.int8	0                               # End Of Children Mark
+	.int8	6                               # Abbrev [6] 0x84:0xb DW_TAG_typedef
+	.int32	144                             # DW_AT_type
+	.int32	.Linfo_string13                 # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	4                               # DW_AT_decl_line
+	.int8	0                               # End Of Children Mark
+	.int8	7                               # Abbrev [7] 0x90:0x7 DW_TAG_base_type
+	.int32	.Linfo_string5                  # DW_AT_name
+	.int8	5                               # DW_AT_encoding
+	.int8	4                               # DW_AT_byte_size
+	.int8	6                               # Abbrev [6] 0x97:0xb DW_TAG_typedef
+	.int32	162                             # DW_AT_type
+	.int32	.Linfo_string7                  # DW_AT_name
+	.int8	1                               # DW_AT_decl_file
+	.int8	1                               # DW_AT_decl_line
+	.int8	8                               # Abbrev [8] 0xa2:0x5 DW_TAG_pointer_type
+	.int32	167                             # DW_AT_type
+	.int8	9                               # Abbrev [9] 0xa7:0x5 DW_TAG_const_type
+	.int32	144                             # DW_AT_type
+	.int8	7                               # Abbrev [7] 0xac:0x7 DW_TAG_base_type
+	.int32	.Linfo_string9                  # DW_AT_name
+	.int8	7                               # DW_AT_encoding
+	.int8	4                               # DW_AT_byte_size
+	.int8	7                               # Abbrev [7] 0xb3:0x7 DW_TAG_base_type
+	.int32	.Linfo_string11                 # DW_AT_name
+	.int8	2                               # DW_AT_encoding
+	.int8	1                               # DW_AT_byte_size
+	.int8	9                               # Abbrev [9] 0xba:0x5 DW_TAG_const_type
+	.int32	132                             # DW_AT_type
+	.int8	0                               # End Of Children Mark
+.Ldebug_info_end0:
+	.section	.debug_str,"S",@
+.Linfo_string0:
+	.asciz	"clang version 19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)" # string offset=0
+.Linfo_string1:
+	.asciz	"test.cpp"                      # string offset=111
+.Linfo_string2:
+	.asciz	"/data/projects/scripts/regression-suite/input/general" # string offset=120
+.Linfo_string3:
+	.asciz	"_Z3fooPKijb"                   # string offset=174
+.Linfo_string4:
+	.asciz	"foo"                           # string offset=186
+.Linfo_string5:
+	.asciz	"int"                           # string offset=190
+.Linfo_string6:
+	.asciz	"ParamPtr"                      # string offset=194
+.Linfo_string7:
+	.asciz	"INTPTR"                        # string offset=203
+.Linfo_string8:
+	.asciz	"ParamUnsigned"                 # string offset=210
+.Linfo_string9:
+	.asciz	"unsigned int"                  # string offset=224
+.Linfo_string10:
+	.asciz	"ParamBool"                     # string offset=237
+.Linfo_string11:
+	.asciz	"bool"                          # string offset=247
+.Linfo_string12:
+	.asciz	"CONSTANT"                      # string offset=252
+.Linfo_string13:
+	.asciz	"INTEGER"                       # string offset=261
+	.ident	"clang version 19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)"
+	.section	.custom_section.producers,"",@
+	.int8	2
+	.int8	8
+	.ascii	"language"
+	.int8	1
+	.int8	14
+	.ascii	"C_plus_plus_14"
+	.int8	0
+	.int8	12
+	.ascii	"processed-by"
+	.int8	1
+	.int8	5
+	.ascii	"clang"
+	.int8	96
+	.ascii	"19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)"
+	.section	.debug_str,"S",@
+	.section	.custom_section.target_features,"",@
+	.int8	2
+	.int8	43
+	.int8	15
+	.ascii	"mutable-globals"
+	.int8	43
+	.int8	8
+	.ascii	"sign-ext"
+	.section	.debug_str,"S",@
+	.section	.debug_line,"",@
+.Lline_table_start0:
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.yaml b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.yaml
deleted file mode 100644
index 183bccf872f5ad..00000000000000
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/Inputs/test-clang.yaml
+++ /dev/null
@@ -1,168 +0,0 @@
---- !WASM
-FileHeader:
-  Version:         0x1
-Sections:
-  - Type:            TYPE
-    Signatures:
-      - Index:           0
-        ParamTypes:
-          - I32
-          - I32
-          - I32
-        ReturnTypes:
-          - I32
-  - Type:            IMPORT
-    Imports:
-      - Module:          env
-        Field:           __linear_memory
-        Kind:            MEMORY
-        Memory:
-          Minimum:         0x0
-      - Module:          env
-        Field:           __stack_pointer
-        Kind:            GLOBAL
-        GlobalType:      I32
-        GlobalMutable:   true
-  - Type:            FUNCTION
-    FunctionTypes:   [ 0 ]
-  - Type:            CODE
-    Relocations:
-      - Type:            R_WASM_GLOBAL_INDEX_LEB
-        Index:           1
-        Offset:          0x6
-    Functions:
-      - Index:           0
-        Locals:
-          - Type:            I32
-            Count:           11
-        Body:            238080808000210341202104200320046B2105200520003602182005200136021420022106200520063A001320052D001321074101210820072008712109024002402009450D004107210A2005200A36020C4107210B2005200B36021C0C010B2005280214210C2005200C36021C0B200528021C210D200D0F0B
-  - Type:            CUSTOM
-    Name:            .debug_abbrev
-    Payload:         011101250E1305030E10171B0E110112060000022E011101120640186E0E030E3A0B3B0B49133F1900000305000218030E3A0B3B0B49130000040B011101120600000534000218030E3A0B3B0B491300000616004913030E3A0B3B0B0000072400030E3E0B0B0B0000080F00491300000926004913000000
-  - Type:            CUSTOM
-    Relocations:
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           2
-        Offset:          0x6
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0xC
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x12
-        Addend:          111
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           4
-        Offset:          0x16
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x1A
-        Addend:          120
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x1E
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x27
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x34
-        Addend:          174
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x38
-        Addend:          186
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x46
-        Addend:          194
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x54
-        Addend:          210
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x62
-        Addend:          237
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x6D
-        Addend:          74
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x79
-        Addend:          252
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x89
-        Addend:          261
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x91
-        Addend:          190
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0x9C
-        Addend:          203
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0xAD
-        Addend:          224
-      - Type:            R_WASM_SECTION_OFFSET_I32
-        Index:           3
-        Offset:          0xB4
-        Addend:          247
-    Name:            .debug_info
-    Payload:         BC00000004000000000004010000000021006F0000000000000078000000020000007D00000002020000007D00000004ED00059FAE000000BA00000001029000000003029118C200000001029700000003029114D20000000102AC00000003029113ED0000000102B3000000044C000000180000000502910CFC0000000105BA0000000006900000000501000001040007BE000000050406A2000000CB000000010108A7000000099000000007E0000000070407F70000000201098400000000
-  - Type:            CUSTOM
-    Name:            .debug_str
-    Payload:         636C616E672076657273696F6E2031392E302E3067697420282F646174612F70726F6A656374732F6C6C766D2D726F6F742F6C6C766D2D70726F6A6563742F636C616E6720326462363730336630633235376432393364663435356532646666386331666236393563343130302900746573742E637070002F646174612F70726F6A656374732F736372697074732F72656772657373696F6E2D73756974652F696E7075742F67656E6572616C005F5A33666F6F504B696A6200666F6F00696E7400506172616D50747200494E5450545200506172616D556E7369676E656400756E7369676E656420696E7400506172616D426F6F6C00626F6F6C00434F4E5354414E5400494E544547455200
-  - Type:            CUSTOM
-    Relocations:
-      - Type:            R_WASM_FUNCTION_OFFSET_I32
-        Index:           0
-        Offset:          0x2D
-    Name:            .debug_line
-    Payload:         58000000040020000000010101FB0E0D00010101010000000100000100746573742E6370700000000000000502020000001305070A022F130674051306083E0505AD06037AC8050A062805030674037874050106030920020B000101
-  - Type:            CUSTOM
-    Name:            linking
-    Version:         2
-    SymbolTable:
-      - Index:           0
-        Kind:            FUNCTION
-        Name:            _Z3fooPKijb
-        Flags:           [ VISIBILITY_HIDDEN ]
-        Function:        0
-      - Index:           1
-        Kind:            GLOBAL
-        Name:            __stack_pointer
-        Flags:           [ UNDEFINED ]
-        Global:          0
-      - Index:           2
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         4
-      - Index:           3
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         6
-      - Index:           4
-        Kind:            SECTION
-        Flags:           [ BINDING_LOCAL ]
-        Section:         7
-  - Type:            CUSTOM
-    Name:            producers
-    Languages:
-      - Name:            C_plus_plus_14
-        Version:         ''
-    Tools:
-      - Name:            clang
-        Version:         '19.0.0git (/data/projects/llvm-root/llvm-project/clang 2db6703f0c257d293df455e2dff8c1fb695c4100)'
-  - Type:            CUSTOM
-    Name:            target_features
-    Features:
-      - Prefix:          USED
-        Name:            mutable-globals
-      - Prefix:          USED
-        Name:            sign-ext
-...
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt
new file mode 100644
index 00000000000000..b064af04bb9363
--- /dev/null
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/README.txt
@@ -0,0 +1,28 @@
+Notes:
+------
+As we should avoid committing binaries (.wasm) to be used in tests,
+instead we provide the '.cpp' source files and the '.s' files.
+
+- For the tests, only the '.s' files are required.
+- We use the target 'wasm32' as the 'wasm64' is not standardized yet.
+
+How to generate .s from .cpp
+----------------------------
+Use clang to generate the '.s'.
+
+  clang --target=wasm32 -S -g Inputs/hello-world.cpp -o Inputs/hello-world-clang.s
+  clang --target=wasm32 -S -g Inputs/pr-43860.cpp    -o Inputs/pr-43860-clang.s
+  clang --target=wasm32 -S -g Inputs/pr-44884.cpp    -o Inputs/pr-44884-clang.s
+  clang --target=wasm32 -S -g Inputs/pr-46466.cpp    -o Inputs/pr-46466-clang.s
+  clang --target=wasm32 -S -g Inputs/test.cpp        -o Inputs/test-clang.s
+
+How to generate .wasm from .s
+--------------------------------
+Each test executes one of the following commands in order to generate
+the binary '.wasm' used by that specific test:
+
+  llvm-mc -arch=wasm32 -filetype=obj %p/Inputs/hello-world-clang.s -o hello-world-clang.wasm
+  llvm-mc -arch=wasm32 -filetype=obj %p/Inputs/pr-43860-clang.s    -o pr-43860-clang.wasm
+  llvm-mc -arch=wasm32 -filetype=obj %p/Inputs/pr-44884-clang.s    -o pr-44884-clang.wasm
+  llvm-mc -arch=wasm32 -filetype=obj %p/Inputs/pr-46466-clang.s    -o pr-46466-clang.wasm
+  llvm-mc -arch=wasm32 -filetype=obj %p/Inputs/test-clang.s        -o test-clang.wasm

>From 082b9ec538a9fccc2d9d7624f3ad5c27baf39019 Mon Sep 17 00:00:00 2001
From: Carlos Alberto Enciso <carlos.alberto.enciso at gmail.com>
Date: Mon, 4 Mar 2024 05:44:39 +0000
Subject: [PATCH 6/7] [llvm-debuginfo-analyzer] Add support for WebAssembly
 binary format.

Add support for the WebAssembly binary format and be able to
generate logical views.

https://github.com/llvm/llvm-project/issues/69181

- Update the 'WasmOffset' only when the current section
  is 'CODE'. In all the other cases, its value is zero.
---
 .../DebugInfo/LogicalView/Readers/LVBinaryReader.cpp   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp b/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp
index 871c1bed039877..5d7c6cbb1625bb 100644
--- a/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp
@@ -186,12 +186,12 @@ void LVBinaryReader::mapVirtualAddress(const object::ObjectFile &Obj) {
     }
     if ((*SectionNameOrErr).equals(".text") ||
         (*SectionNameOrErr).equals("CODE") ||
-        (*SectionNameOrErr).equals(".code"))
+        (*SectionNameOrErr).equals(".code")) {
       DotTextSectionIndex = Section.getIndex();
-    // If the object is WebAssembly, update the address offset that
-    // will be added to DWARF DW_AT_* attributes.
-    if (Obj.isWasm()) {
-      WasmOffset = Section.getAddress();
+      // If the object is WebAssembly, update the address offset that
+      // will be added to DWARF DW_AT_* attributes.
+      if (Obj.isWasm())
+        WasmOffset = Section.getAddress();
     }
   }
 

>From 756413634cce5ce9008b5ac79cb374cc927d2d12 Mon Sep 17 00:00:00 2001
From: Carlos Alberto Enciso <carlos.alberto.enciso at gmail.com>
Date: Mon, 4 Mar 2024 16:06:24 +0000
Subject: [PATCH 7/7] [llvm-debuginfo-analyzer] Add support for WebAssembly
 binary format.

Add support for the WebAssembly binary format and be able to
generate logical views.

https://github.com/llvm/llvm-project/issues/69181

- Add the '%t' prefix to the generated 'wasm' files to avoid
  any race condition, as there are tests that use the same
  generated 'wasm'.
---
 .../01-wasm-compare-logical-elements.test        | 16 ++++++++--------
 .../WebAssembly/01-wasm-print-basic-details.test |  8 ++++----
 .../01-wasm-select-logical-elements.test         | 10 +++++-----
 .../WebAssembly/02-wasm-logical-lines.test       |  6 +++---
 .../03-wasm-incorrect-lexical-scope-typedef.test | 10 +++++-----
 .../04-wasm-missing-nested-enumerators.test      | 14 +++++++-------
 ...05-wasm-incorrect-lexical-scope-variable.test | 10 +++++-----
 .../WebAssembly/06-wasm-full-logical-view.test   |  4 ++--
 8 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test
index 634a041b648fb4..fed8483da1fb7e 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-compare-logical-elements.test
@@ -18,21 +18,21 @@
 ; giving more context by swapping the reference and target object files.
 
 ; RUN: llvm-mc -arch=wasm32 -filetype=obj \
-; RUN:         %p/Inputs/test-clang.s -o test-clang.wasm
+; RUN:         %p/Inputs/test-clang.s -o %t.test-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level \
 ; RUN:                         --compare=types \
 ; RUN:                         --report=view \
 ; RUN:                         --print=symbols,types \
-; RUN:                         test-clang.wasm \
+; RUN:                         %t.test-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
-; ONE:      Reference: 'test-clang.wasm'
+; ONE:      Reference: '{{.*}}test-clang.wasm'
 ; ONE-NEXT: Target:    'test-dwarf-gcc.o'
 ; ONE-EMPTY:
 ; ONE-NEXT: Logical View:
-; ONE-NEXT:  [000]           {File} 'test-clang.wasm'
+; ONE-NEXT:  [000]           {File} '{{.*}}test-clang.wasm'
 ; ONE-EMPTY:
 ; ONE-NEXT:  [001]             {CompileUnit} 'test.cpp'
 ; ONE-NEXT:  [002]     1         {TypeAlias} 'INTPTR' -> '* const int'
@@ -53,11 +53,11 @@
 ; RUN:                         --compare=types \
 ; RUN:                         --report=list \
 ; RUN:                         --print=symbols,types,summary \
-; RUN:                         test-clang.wasm \
+; RUN:                         %t.test-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s
 
-; TWO:      Reference: 'test-clang.wasm'
+; TWO:      Reference: '{{.*}}test-clang.wasm'
 ; TWO-NEXT: Target:    'test-dwarf-gcc.o'
 ; TWO-EMPTY:
 ; TWO-NEXT: (1) Missing Types:
@@ -83,11 +83,11 @@
 ; RUN:                         --report=list \
 ; RUN:                         --print=symbols,types,summary \
 ; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o \
-; RUN:                         test-clang.wasm 2>&1 | \
+; RUN:                         %t.test-clang.wasm 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=THR %s
 
 ; THR:      Reference: 'test-dwarf-gcc.o'
-; THR-NEXT: Target:    'test-clang.wasm'
+; THR-NEXT: Target:    '{{.*}}test-clang.wasm'
 ; THR-EMPTY:
 ; THR-NEXT: (1) Missing Types:
 ; THR-NEXT: -[004]     4     {TypeAlias} 'INTEGER' -> 'int'
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
index e29d67bf5adb2e..5520eae7560d12 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-print-basic-details.test
@@ -19,22 +19,22 @@
 ; level and debug info format.
 
 ; RUN: llvm-mc -arch=wasm32 -filetype=obj \
-; RUN:         %p/Inputs/test-clang.s -o test-clang.wasm
+; RUN:         %p/Inputs/test-clang.s -o %t.test-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format \
 ; RUN:                         --output-sort=offset \
 ; RUN:                         --print=scopes,symbols,types,lines,instructions \
-; RUN:                         test-clang.wasm 2>&1 | \
+; RUN:                         %t.test-clang.wasm 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format \
 ; RUN:                         --output-sort=offset \
 ; RUN:                         --print=elements \
-; RUN:                         test-clang.wasm 2>&1 | \
+; RUN:                         %t.test-clang.wasm 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
 ; ONE:      Logical View:
-; ONE-NEXT: [000]           {File} 'test-clang.wasm' -> WASM
+; ONE-NEXT: [000]           {File} '{{.*}}test-clang.wasm' -> WASM
 ; ONE-EMPTY:
 ; ONE-NEXT: [001]             {CompileUnit} 'test.cpp'
 ; ONE-NEXT: [002]     2         {Function} extern not_inlined 'foo' -> 'int'
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
index 569381b00a8968..7c96764d51972a 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/01-wasm-select-logical-elements.test
@@ -19,18 +19,18 @@
 ; and given the number of matches.
 
 ; RUN: llvm-mc -arch=wasm32 -filetype=obj \
-; RUN:         %p/Inputs/test-clang.s -o test-clang.wasm
+; RUN:         %p/Inputs/test-clang.s -o %t.test-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level \
 ; RUN:                         --select-nocase --select-regex \
 ; RUN:                         --select=BLOCK --select=.store \
 ; RUN:                         --report=list \
 ; RUN:                         --print=symbols,types,instructions,summary \
-; RUN:                         test-clang.wasm 2>&1 | \
+; RUN:                         %t.test-clang.wasm 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
 ; ONE:      Logical View:
-; ONE-NEXT: [000]           {File} 'test-clang.wasm'
+; ONE-NEXT: [000]           {File} '{{.*}}test-clang.wasm'
 ; ONE-EMPTY:
 ; ONE-NEXT: [001]           {CompileUnit} 'test.cpp'
 ; ONE-NEXT: [003]           {Code} 'block'
@@ -57,12 +57,12 @@
 ; RUN:                         --select=INTe \
 ; RUN:                         --report=list \
 ; RUN:                         --print=symbols,types \
-; RUN:                         test-clang.wasm \
+; RUN:                         %t.test-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/test-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s
 
 ; TWO:      Logical View:
-; TWO-NEXT: [000]           {File} 'test-clang.wasm'
+; TWO-NEXT: [000]           {File} '{{.*}}test-clang.wasm'
 ; TWO-EMPTY:
 ; TWO-NEXT: [001]           {CompileUnit} 'test.cpp'
 ; TWO-NEXT: [003]     4     {TypeAlias} 'INTEGER' -> 'int'
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
index 3e4204778bb679..da5380f6587701 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test
@@ -16,15 +16,15 @@
 ; allowing to compare the code generated by the different toolchains.
 
 ; RUN: llvm-mc -arch=wasm32 -filetype=obj \
-; RUN:         %p/Inputs/hello-world-clang.s -o hello-world-clang.wasm
+; RUN:         %p/Inputs/hello-world-clang.s -o %t.hello-world-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
 ; RUN:                         --print=lines,instructions \
-; RUN:                         hello-world-clang.wasm 2>&1 | \
+; RUN:                         %t.hello-world-clang.wasm 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
 ; ONE:      Logical View:
-; ONE-NEXT: [000]           {File} 'hello-world-clang.wasm' -> WASM
+; ONE-NEXT: [000]           {File} '{{.*}}hello-world-clang.wasm' -> WASM
 ; ONE-EMPTY:
 ; ONE-NEXT: [001]             {CompileUnit} 'hello-world.cpp'
 ; ONE-NEXT: [002]               {Producer} 'clang version 19{{.*}}'
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test
index 88bb02fc340252..85a80b33e223ad 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test
@@ -31,17 +31,17 @@
 ; GCC emit correct lexical scope for both typedefs.
 
 ; RUN: llvm-mc -arch=wasm32 -filetype=obj \
-; RUN:         %p/Inputs/pr-44884-clang.s -o pr-44884-clang.wasm
+; RUN:         %p/Inputs/pr-44884-clang.s -o %t.pr-44884-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
 ; RUN:                         --output-sort=kind \
 ; RUN:                         --print=symbols,types,lines \
-; RUN:                         pr-44884-clang.wasm \
+; RUN:                         %t.pr-44884-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/pr-44884-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
 ; ONE:      Logical View:
-; ONE-NEXT: [000]           {File} 'pr-44884-clang.wasm' -> WASM
+; ONE-NEXT: [000]           {File} '{{.*}}pr-44884-clang.wasm' -> WASM
 ; ONE-EMPTY:
 ; ONE-NEXT: [001]             {CompileUnit} 'pr-44884.cpp'
 ; ONE-NEXT: [002]               {Producer} 'clang version 19{{.*}}'
@@ -116,12 +116,12 @@
 ; RUN:                         --select-types=Typedef \
 ; RUN:                         --report=list \
 ; RUN:                         --print=types \
-; RUN:                         pr-44884-clang.wasm \
+; RUN:                         %t.pr-44884-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/pr-44884-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s
 
 ; TWO:      Logical View:
-; TWO-NEXT: [000]           {File} 'pr-44884-clang.wasm' -> WASM
+; TWO-NEXT: [000]           {File} '{{.*}}pr-44884-clang.wasm' -> WASM
 ; TWO-EMPTY:
 ; TWO-NEXT: [001]           {CompileUnit} 'pr-44884.cpp'
 ; TWO-NEXT: [003]     7     {TypeAlias} 'FLOAT' -> 'float'
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test
index 254610cd7ebe08..522347ba31cd57 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test
@@ -26,17 +26,17 @@
 ; by GCC, does include such references.
 
 ; RUN: llvm-mc -arch=wasm32 -filetype=obj \
-; RUN:         %p/Inputs/pr-46466-clang.s -o pr-46466-clang.wasm
+; RUN:         %p/Inputs/pr-46466-clang.s -o %t.pr-46466-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
 ; RUN:                         --output-sort=name \
 ; RUN:                         --print=symbols,types \
-; RUN:                         pr-46466-clang.wasm \
+; RUN:                         %t.pr-46466-clang.wasm \
 ; 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.wasm' -> WASM
+; ONE-NEXT: [000]           {File} '{{.*}}pr-46466-clang.wasm' -> WASM
 ; ONE-EMPTY:
 ; ONE-NEXT: [001]             {CompileUnit} 'pr-46466.cpp'
 ; ONE-NEXT: [002]               {Producer} 'clang version 19{{.*}}'
@@ -66,12 +66,12 @@
 ; RUN:                         --select-types=Enumerator \
 ; RUN:                         --report=parents \
 ; RUN:                         --print=types \
-; RUN:                         pr-46466-clang.wasm \
+; RUN:                         %t.pr-46466-clang.wasm \
 ; 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.wasm' -> WASM
+; TWO-NEXT: [000]           {File} '{{.*}}pr-46466-clang.wasm' -> WASM
 ; TWO-EMPTY:
 ; TWO-NEXT: [001]             {CompileUnit} 'pr-46466.cpp'
 ; TWO-EMPTY:
@@ -93,12 +93,12 @@
 ; RUN:                         --output-sort=name \
 ; RUN:                         --select-types=Enumerator \
 ; RUN:                         --print=types,summary \
-; RUN:                         pr-46466-clang.wasm \
+; RUN:                         %t.pr-46466-clang.wasm \
 ; 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.wasm' -> WASM
+; THR-NEXT: [000]           {File} '{{.*}}pr-46466-clang.wasm' -> WASM
 ; THR-EMPTY:
 ; THR-NEXT: [001]           {CompileUnit} 'pr-46466.cpp'
 ; THR-EMPTY:
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test
index 26e792d9f3fc78..ab5f91e8acf119 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test
@@ -32,17 +32,17 @@
 ; lexical scope: '3' and '4' respectively.
 
 ; RUN: llvm-mc -arch=wasm32 -filetype=obj \
-; RUN:         %p/Inputs/pr-43860-clang.s -o pr-43860-clang.wasm
+; RUN:         %p/Inputs/pr-43860-clang.s -o %t.pr-43860-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
 ; RUN:                         --output-sort=name \
 ; RUN:                         --print=symbols \
-; RUN:                         pr-43860-clang.wasm \
+; RUN:                         %t.pr-43860-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/pr-43860-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
 ; ONE:      Logical View:
-; ONE-NEXT: [000]           {File} 'pr-43860-clang.wasm' -> WASM
+; ONE-NEXT: [000]           {File} '{{.*}}pr-43860-clang.wasm' -> WASM
 ; ONE-EMPTY:
 ; ONE-NEXT: [001]             {CompileUnit} 'pr-43860.cpp'
 ; ONE-NEXT: [002]               {Producer} 'clang version 19{{.*}}'
@@ -91,12 +91,12 @@
 ; RUN:                         --select=Var \
 ; RUN:                         --report=list \
 ; RUN:                         --print=symbols \
-; RUN:                         pr-43860-clang.wasm \
+; RUN:                         %t.pr-43860-clang.wasm \
 ; RUN:                         %p/../DWARF/Inputs/pr-43860-dwarf-gcc.o 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=TWO %s
 
 ; TWO:      Logical View:
-; TWO-NEXT: [000]           {File} 'pr-43860-clang.wasm' -> WASM
+; TWO-NEXT: [000]           {File} '{{.*}}pr-43860-clang.wasm' -> WASM
 ; TWO-EMPTY:
 ; TWO-NEXT: [001]           {CompileUnit} 'pr-43860.cpp'
 ; TWO-NEXT: [004]           {Variable} 'Var_1' -> 'int'
diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
index 1e7e2073f869f4..4b0ec408116660 100644
--- a/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
+++ b/llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test
@@ -19,11 +19,11 @@
 ; operands, linkage names, etc.
 
 ; RUN: llvm-mc -arch=wasm32 -filetype=obj \
-; RUN:         %p/Inputs/test-clang.s -o test-clang.wasm
+; RUN:         %p/Inputs/test-clang.s -o %t.test-clang.wasm
 
 ; RUN: llvm-debuginfo-analyzer --attribute=all \
 ; RUN:                         --print=all \
-; RUN:                         test-clang.wasm 2>&1 | \
+; RUN:                         %t.test-clang.wasm 2>&1 | \
 ; RUN: FileCheck --strict-whitespace -check-prefix=ONE %s
 
 ; ONE:      Logical View:



More information about the llvm-commits mailing list