xref: /llvm-project/llvm/test/Object/Wasm/linked-symbol-table.yaml (revision 0d96422768908a8235f05a5d3b1d43ecc6038004)
1# RUN: yaml2obj %s -o %t.wasm
2# RUN: llvm-objdump -t %t.wasm | FileCheck %s
3#
4# CHECK:      SYMBOL TABLE:
5# CHECK-NEXT: 0000009f g F CODE 00000003 my_func_export
6# CHECK-NEXT: 0000002a g O DATA 00000000 my_global_export
7# CHECK-NEXT: 00000000 g   TABLE 00000000 my_table_export
8
9--- !WASM
10FileHeader:
11  Version:         0x1
12Sections:
13  - Type:            TYPE
14    Signatures:
15      - Index:           0
16        ParamTypes:      []
17        ReturnTypes:     []
18  - Type:            IMPORT
19    Imports:
20      - Module:          env
21        Field:           foo
22        Kind:            FUNCTION
23        SigIndex:        0
24      - Module:          env
25        Field:           bar
26        Kind:            GLOBAL
27        GlobalType:      I32
28        GlobalMutable:   true
29      - Module:          env
30        Field:           memory
31        Kind:            MEMORY
32        Memory:
33          Minimum:         0x1
34  - Type:            FUNCTION
35    FunctionTypes:   [ 0 ]
36  - Type:            TABLE
37    Tables:
38      - Index:           0
39        ElemType:        FUNCREF
40        Limits:
41          Flags:           [ HAS_MAX ]
42          Minimum:         0x1
43          Maximum:         0x1
44  - Type:            GLOBAL
45    Globals:
46      - Index:           1
47        Mutable:         false
48        Type:            I32
49        InitExpr:
50          Opcode:          I32_CONST
51          Value:           42
52  - Type:            EXPORT
53    Exports:
54      - Name:            my_func_export
55        Kind:            FUNCTION
56        Index:           1
57      - Name:            my_global_export
58        Kind:            GLOBAL
59        Index:           1
60      - Name:            my_table_export
61        Kind:            TABLE
62        Index:           0
63  - Type:            CODE
64    Functions:
65      - Index:           1
66        Locals:
67        Body:            00
68  - Type:            DATA
69    Segments:
70      - SectionOffset:   0
71        InitFlags:       0
72        Offset:
73          Opcode:          I32_CONST
74          Value:           0
75        Content:         ''
76