1 RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/start.s -o %t.o
3 RUN: wasm-ld --export=__global_base --export=__data_end --allow-undefined -o %t.wasm %t.o
4 RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=CHECK-1024
5 CHECK-1024: - Type: GLOBAL
6 CHECK-1024-NEXT: Globals:
7 CHECK-1024-NEXT: - Index: 0
8 CHECK-1024-NEXT: Type: I32
9 CHECK-1024-NEXT: Mutable: true
10 CHECK-1024-NEXT: InitExpr:
11 CHECK-1024-NEXT: Opcode: I32_CONST
12 CHECK-1024-NEXT: Value: 66560
13 CHECK-1024-NEXT: - Index: 1
14 CHECK-1024-NEXT: Type: I32
15 CHECK-1024-NEXT: Mutable: false
16 CHECK-1024-NEXT: InitExpr:
17 CHECK-1024-NEXT: Opcode: I32_CONST
18 CHECK-1024-NEXT: Value: 1024
19 CHECK-1024-NEXT: - Index: 2
20 CHECK-1024-NEXT: Type: I32
21 CHECK-1024-NEXT: Mutable: false
22 CHECK-1024-NEXT: InitExpr:
23 CHECK-1024-NEXT: Opcode: I32_CONST
24 CHECK-1024-NEXT: Value: 1024
26 CHECK-1024: - Type: EXPORT
27 CHECK-1024: - Name: __data_end
28 CHECK-1024-NEXT: Kind: GLOBAL
29 CHECK-1024-NEXT: Index: 1
30 CHECK-1024-NEXT: - Name: __global_base
31 CHECK-1024-NEXT: Kind: GLOBAL
32 CHECK-1024-NEXT: Index: 2
34 RUN: wasm-ld --export=__global_base --export=__data_end --allow-undefined --global-base=16777216 -o %t.wasm %t.o
35 RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=CHECK-16777216
36 CHECK-16777216: - Type: GLOBAL
37 CHECK-16777216-NEXT: Globals:
38 CHECK-16777216-NEXT: - Index: 0
39 CHECK-16777216-NEXT: Type: I32
40 CHECK-16777216-NEXT: Mutable: true
41 CHECK-16777216-NEXT: InitExpr:
42 CHECK-16777216-NEXT: Opcode: I32_CONST
43 CHECK-16777216-NEXT: Value: 16842752
44 CHECK-16777216-NEXT: - Index: 1
45 CHECK-16777216-NEXT: Type: I32
46 CHECK-16777216-NEXT: Mutable: false
47 CHECK-16777216-NEXT: InitExpr:
48 CHECK-16777216-NEXT: Opcode: I32_CONST
49 CHECK-16777216-NEXT: Value: 16777216
50 CHECK-16777216-NEXT: - Index: 2
51 CHECK-16777216-NEXT: Type: I32
52 CHECK-16777216-NEXT: Mutable: false
53 CHECK-16777216-NEXT: InitExpr:
54 CHECK-16777216-NEXT: Opcode: I32_CONST
55 CHECK-16777216-NEXT: Value: 16777216
57 CHECK-16777216: - Type: EXPORT
58 CHECK-16777216: - Name: __data_end
59 CHECK-16777216-NEXT: Kind: GLOBAL
60 CHECK-16777216-NEXT: Index: 1
61 CHECK-16777216-NEXT: - Name: __global_base
62 CHECK-16777216-NEXT: Kind: GLOBAL
63 CHECK-16777216-NEXT: Index: 2