xref: /llvm-project/llvm/test/tools/llvm-objdump/wasm/linked-symbol-table-namesec.yaml (revision 2eaeae7e9a298b8a4c9a313f914c42f1e0b82c39)
1# RUN: yaml2obj %s -o %t.wasm
2# RUN: llvm-objdump -t %t.wasm | FileCheck %s
3#
4# CHECK:      SYMBOL TABLE:
5# CHECK-NEXT: 00000000   F *UND* 00000000 my_func_import_name
6# CHECK-NEXT: 0000008c g F CODE 00000003 my_func_export_name
7# CHECK-NEXT: 0000008f l F CODE 00000003 my_func_local_name
8# CHECK-NEXT: 00000000    *UND* 00000000 my_global_import_name
9# CHECK-NEXT: 0000004c g  GLOBAL 00000005 my_global_export_name
10# CHECK-NEXT: 00000051 g  GLOBAL 00000009 my_global_local_name
11# CHECK-NEXT: 00000000 l O DATA 00000004 my_datasegment_name
12
13--- !WASM
14FileHeader:
15  Version:         0x1
16Sections:
17  - Type:            TYPE
18    Signatures:
19      - Index:           0
20        ParamTypes:      []
21        ReturnTypes:     []
22  - Type:            IMPORT
23    Imports:
24      - Module:          env
25        Field:           foo
26        Kind:            FUNCTION
27        SigIndex:        0
28      - Module:          env
29        Field:           bar
30        Kind:            GLOBAL
31        GlobalType:      I32
32        GlobalMutable:   true
33      - Module:          env
34        Field:           memory
35        Kind:            MEMORY
36        Memory:
37          Minimum:         0x1
38  - Type:            FUNCTION
39    FunctionTypes:   [ 0, 0 ]
40  - Type:            GLOBAL
41    Globals:
42      - Index:           1
43        Mutable:         false
44        Type:            I32
45        InitExpr:
46          Opcode:          I32_CONST
47          Value:           42
48      - Index:           2
49        Mutable:         true
50        Type:            I64
51        InitExpr:
52          Opcode:          I64_CONST
53          Value:           5000000000
54  - Type:            EXPORT
55    Exports:
56      - Name:            my_func_export
57        Kind:            FUNCTION
58        Index:           1
59      - Name:            my_global_export
60        Kind:            GLOBAL
61        Index:           1
62  - Type:            CODE
63    Functions:
64      - Index:           1
65        Locals:
66        Body:            00
67      - Index:           2
68        Locals:
69        Body:            00
70  - Type:            DATA
71    Segments:
72      - SectionOffset:   0
73        InitFlags:       0
74        Offset:
75          Opcode:          I32_CONST
76          Value:           0
77        Content:         'abcd1234'
78  - Type:            CUSTOM
79    Name:            name
80    FunctionNames:
81     - Index:        0
82       Name:         my_func_import_name
83     - Index:        1
84       Name:         my_func_export_name
85     - Index:        2
86       Name:         my_func_local_name
87    GlobalNames:
88     - Index:        0
89       Name:         my_global_import_name
90     - Index:        1
91       Name:         my_global_export_name
92     - Index:        2
93       Name:         my_global_local_name
94    DataSegmentNames:
95     - Index:        0
96       Name:         my_datasegment_name
97