llvm.org GIT mirror llvm / e286417 test / tools / llvm-nm / wasm / exports.yaml
e286417

Tree @e286417 (Download .tar.gz)

exports.yaml @e286417raw · history · blame

# RUN: yaml2obj < %s | llvm-nm - | FileCheck -strict-whitespace %s

# That wasm exports of functions and globals are displayed as global data and
# code symbols.

--- !WASM
FileHeader:
  Version:         0x00000001
Sections:
  - Type:            TYPE
    Signatures:
      - ReturnType:      I32
        ParamTypes:
          - I32
  - Type:            FUNCTION
    FunctionTypes: [ 0, 0, 0, 0, 0 ]
  - Type:            GLOBAL
    Globals:
      - Type:        I32
        Mutable:     false
        InitExpr:
          Opcode:          I64_CONST
          Value:           32
      - Type:        I32
        Mutable:     false
        InitExpr:
          Opcode:          I32_CONST
          Value:           64
      - Type:        I32
        Mutable:     false
        InitExpr:
          Opcode:          I32_CONST
          Value:           1024
  - Type:            IMPORT
    Imports:
      - Module:          env
        Field:           fimport
        Kind:            FUNCTION
        SigIndex:        0
      - Module:          env
        Field:           gimport
        Kind:            GLOBAL
        GlobalType:      I32
        GlobalMutable:   false
  - Type:            EXPORT
    Exports:
      - Name:            foo
        Kind:            FUNCTION
        Index:           0x00000004
      - Name:            bar
        Kind:            GLOBAL
        Index:           0x00000003
  - Type:            CUSTOM
    Name:            "linking"
    DataSize:        0

# CHECK:      00000400 D bar
# CHECK-NEXT:          U fimport
# CHECK-NEXT: 00000004 T foo
# CHECK-NEXT:          U gimport