1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/start.s -o %t.start.o
2 # RUN: wasm-ld --import-memory -o %t.wasm %t.start.o
3 # RUN: obj2yaml %t.wasm | FileCheck %s
5 # Verify the --import-memory flag creates a memory import
7 # CHECK: - Type: IMPORT
9 # CHECK-NEXT: - Module: env
10 # CHECK-NEXT: Field: memory
11 # CHECK-NEXT: Kind: MEMORY
13 # CHECK-NEXT: Minimum: 0x2
18 # RUN: wasm-ld --import-memory --initial-memory=262144 \
19 # RUN: --max-memory=327680 -o %t.max.wasm %t.start.o
20 # RUN: obj2yaml %t.max.wasm | FileCheck -check-prefix=CHECK-MAX %s
22 # Verify the --initial-memory and --max-memory arguments work with imports
24 # CHECK-MAX: - Type: IMPORT
25 # CHECK-MAX-NEXT: Imports:
26 # CHECK-MAX-NEXT: - Module: env
27 # CHECK-MAX-NEXT: Field: memory
28 # CHECK-MAX-NEXT: Kind: MEMORY
29 # CHECK-MAX-NEXT: Memory:
30 # CHECK-MAX-NEXT: Flags: [ HAS_MAX ]
31 # CHECK-MAX-NEXT: Minimum: 0x4
32 # CHECK-MAX-NEXT: Maximum: 0x5
33 # CHECK-MAX-NEXT: - Type:
35 # RUN: wasm-ld --import-memory --shared-memory --features=atomics,bulk-memory \
36 # RUN: --initial-memory=262144 --max-memory=327680 -o %t.max.wasm %t.start.o
37 # RUN: obj2yaml %t.max.wasm | FileCheck -check-prefix=CHECK-SHARED %s
39 # Verify the --shared-memory flag works with imports
41 # CHECK-SHARED: - Type: IMPORT
42 # CHECK-SHARED-NEXT: Imports:
43 # CHECK-SHARED-NEXT: - Module: env
44 # CHECK-SHARED-NEXT: Field: memory
45 # CHECK-SHARED-NEXT: Kind: MEMORY
46 # CHECK-SHARED-NEXT: Memory:
47 # CHECK-SHARED-NEXT: Flags: [ HAS_MAX, IS_SHARED ]
48 # CHECK-SHARED-NEXT: Minimum: 0x4
49 # CHECK-SHARED-NEXT: Maximum: 0x5
50 # CHECK-SHARED-NEXT: - Type: