1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t.o
3 # RUN: wasm-ld --export=__table_base -o %t.wasm %t.o
4 # RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=CHECK-DEFAULT
6 # RUN: wasm-ld --table-base=100 --export=__table_base -o %t.wasm %t.o
7 # RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=CHECK-100
11 .functype _start () -> ()
16 # CHECK-DEFAULT: - Type: TABLE
17 # CHECK-DEFAULT-NEXT: Tables:
18 # CHECK-DEFAULT-NEXT: - Index: 0
19 # CHECK-DEFAULT-NEXT: ElemType: FUNCREF
20 # CHECK-DEFAULT-NEXT: Limits:
21 # CHECK-DEFAULT-NEXT: Flags: [ HAS_MAX ]
22 # CHECK-DEFAULT-NEXT: Minimum: 0x2
23 # CHECK-DEFAULT-NEXT: Maximum: 0x2
25 # CHECK-DEFAULT: - Type: GLOBAL
26 # CHECK-DEFAULT-NEXT: Globals:
27 # CHECK-DEFAULT-NEXT: - Index: 0
28 # CHECK-DEFAULT-NEXT: Type: I32
29 # CHECK-DEFAULT-NEXT: Mutable: true
30 # CHECK-DEFAULT-NEXT: InitExpr:
31 # CHECK-DEFAULT-NEXT: Opcode: I32_CONST
32 # CHECK-DEFAULT-NEXT: Value: 66560
33 # CHECK-DEFAULT-NEXT: - Index: 1
34 # CHECK-DEFAULT-NEXT: Type: I32
35 # CHECK-DEFAULT-NEXT: Mutable: false
36 # CHECK-DEFAULT-NEXT: InitExpr:
37 # CHECK-DEFAULT-NEXT: Opcode: I32_CONST
38 # CHECK-DEFAULT-NEXT: Value: 1
40 # CHECK-DEFAULT: - Type: EXPORT
41 # CHECK-DEFAULT: - Name: __table_base
42 # CHECK-DEFAULT-NEXT: Kind: GLOBAL
43 # CHECK-DEFAULT-NEXT: Index: 1
45 # CHECK-100: - Type: TABLE
46 # CHECK-100-NEXT: Tables:
47 # CHECK-100-NEXT: - Index: 0
48 # CHECK-100-NEXT: ElemType: FUNCREF
49 # CHECK-100-NEXT: Limits:
50 # CHECK-100-NEXT: Flags: [ HAS_MAX ]
51 # CHECK-100-NEXT: Minimum: 0x65
52 # CHECK-100-NEXT: Maximum: 0x65
54 # CHECK-100: - Type: GLOBAL
55 # CHECK-100-NEXT: Globals:
56 # CHECK-100-NEXT: - Index: 0
57 # CHECK-100-NEXT: Type: I32
58 # CHECK-100-NEXT: Mutable: true
59 # CHECK-100-NEXT: InitExpr:
60 # CHECK-100-NEXT: Opcode: I32_CONST
61 # CHECK-100-NEXT: Value: 66560
62 # CHECK-100-NEXT: - Index: 1
63 # CHECK-100-NEXT: Type: I32
64 # CHECK-100-NEXT: Mutable: false
65 # CHECK-100-NEXT: InitExpr:
66 # CHECK-100-NEXT: Opcode: I32_CONST
67 # CHECK-100-NEXT: Value: 100
69 # CHECK-100: - Type: EXPORT
70 # CHECK-100: - Name: __table_base
71 # CHECK-100-NEXT: Kind: GLOBAL
72 # CHECK-100-NEXT: Index: 1