llvm/llvm/test/Object/Wasm/obj2yaml-tables.test

RUN: obj2yaml %p/../Inputs/WASM/multi-table.wasm | FileCheck %s


# CHECK:  - Type:            TABLE
# CHECK:    Tables:
# CHECK:      - Index:           1
# CHECK:        ElemType:        FUNCREF
# CHECK:        Limits:
# CHECK:          Flags:           [ HAS_MAX ]
# CHECK:          Minimum:         0x3
# CHECK:          Maximum:         0x3
# CHECK:      - Index:           2
# CHECK:        ElemType:        FUNCREF
# CHECK:        Limits:
# CHECK:          Flags:           [ HAS_MAX ]
# CHECK:          Minimum:         0x4
# CHECK:          Maximum:         0x4
# CHECK:      - Index:           3
# CHECK:        ElemType:        EXTERNREF
# CHECK:        Limits:
# CHECK:          Minimum:         0x0
# CHECK:      - Index:           4
# CHECK:        ElemType:        OTHERREF
# CHECK:        Limits:
# CHECK:          Flags:           [ HAS_MAX ]
# CHECK:          Minimum:         0x5
# CHECK:          Maximum:         0x5
# CHECK:  - Type:            GLOBAL
# CHECK:    Globals:
# CHECK:      - Index:           0
# CHECK:        Type:            OTHERREF
# CHECK:        Mutable:         false
# CHECK:        InitExpr:
# CHECK:          Extended:        true
# CHECK:          Body:            D2000B
# CHECK:      - Index:           1
# CHECK:        Type:            I32
# CHECK:        Mutable:         false
# CHECK:        InitExpr:
# CHECK:          Opcode:          I32_CONST
# CHECK:          Value:           0
# CHECK:  - Type:            ELEM
# CHECK:    Segments:
# CHECK:      - Offset:
# CHECK:          Opcode:          I32_CONST
# CHECK:          Value:           0
# CHECK:        Functions:       [ 0 ]
# CHECK:      - Flags:           2
# CHECK:        TableNumber:     1
# CHECK:        ElemKind:        FUNCREF
# CHECK:        Offset:
# CHECK:          Opcode:          I32_CONST
# CHECK:          Value:           0
# CHECK:        Functions:       [ 0 ]
# CHECK:      - Flags:           2
# CHECK:        TableNumber:     1
# CHECK:        ElemKind:        FUNCREF
# CHECK:        Offset:
# CHECK:          Opcode:          I32_CONST
# CHECK:          Value:           1
# CHECK:        Functions:       [ 0, 1 ]
# CHECK:      - Flags:           6
# CHECK:        TableNumber:     2
# CHECK:        ElemKind:        FUNCREF
# CHECK:        Offset:
# CHECK:          Opcode:          GLOBAL_GET
# CHECK:          Index:           1
# There are 2 funcions encoded with initexprs in this segment
# but initexprs in tables are unmodeled.
# CHECK:        Functions:       [  ]
# CHECK:      - Flags:           6
# CHECK:        TableNumber:     2
# This elemkind is OTHERREF because it's encoded as a typed funcref
# CHECK:        ElemKind:        OTHERREF
# CHECK:        Offset:
# CHECK:          Opcode:          I32_CONST
# CHECK:          Value:           2
# CHECK:        Functions:       [  ]
# CHECK:      - Flags:           1
# CHECK:        ElemKind:        FUNCREF
# CHECK:        Offset:
# CHECK:          Opcode:          I32_CONST
# CHECK:          Value:           0
# CHECK:        Functions:       [ 0, 1 ]
# CHECK:      - Flags:           5
# CHECK:        ElemKind:        FUNCREF
# CHECK:        Offset:
# CHECK:          Opcode:          I32_CONST
# CHECK:          Value:           0
# Empty function list, encoded with initexprs
# CHECK:        Functions:       [  ]
# CHECK:      - Flags:           5
# CHECK:        ElemKind:        OTHERREF
# CHECK:        Offset:
# CHECK:          Opcode:          I32_CONST
# CHECK:          Value:           0
# Function list encoded with initexprs
# CHECK:        Functions:       [  ]
# CHECK:      - Flags:           1
# CHECK:        ElemKind:        FUNCREF
# CHECK:        Offset:
# CHECK:          Opcode:          I32_CONST
# CHECK:          Value:           0
# CHECK:        Functions:       [  ]
# CHECK:      - Flags:           6
# CHECK:        TableNumber:     4
# CHECK:        ElemKind:        OTHERREF
# CHECK:        Offset:
# CHECK:          Opcode:          I32_CONST
# CHECK:          Value:           0
# Function list encoded with initexprs
# CHECK:        Functions:       [  ]