llvm-project/lld/test/wasm/import-memory.test
Sam Clegg 752494bfe3 [WebAssembly] Check function signatures by default
But only produce a warning (for now) unless --fatal-warnings
is passed.

Differential Revision: https://reviews.llvm.org/D46484

llvm-svn: 331574
2018-05-05 01:23:07 +00:00

34 lines
1.2 KiB
Plaintext

# RUN: llc -filetype=obj %p/Inputs/start.ll -o %t.start.o
# RUN: wasm-ld --import-memory -o %t.wasm %t.start.o
# RUN: obj2yaml %t.wasm | FileCheck %s
# Verify the --import-memory flag creates a memory import
# CHECK: - Type: IMPORT
# CHECK-NEXT: Imports:
# CHECK-NEXT: - Module: env
# CHECK-NEXT: Field: memory
# CHECK-NEXT: Kind: MEMORY
# CHECK-NEXT: Memory:
# CHECK-NEXT: Initial: 0x00000002
# CHECK-NEXT: - Type:
# RUN: wasm-ld --import-memory --initial-memory=262144 \
# RUN: --max-memory=327680 -o %t.max.wasm %t.start.o
# RUN: obj2yaml %t.max.wasm | FileCheck -check-prefix=CHECK-MAX %s
# Verify the --initial-memory and --max-memory arguments work with imports
# CHECK-MAX: - Type: IMPORT
# CHECK-MAX-NEXT: Imports:
# CHECK-MAX-NEXT: - Module: env
# CHECK-MAX-NEXT: Field: memory
# CHECK-MAX-NEXT: Kind: MEMORY
# CHECK-MAX-NEXT: Memory:
# CHECK-MAX-NEXT: Flags: [ HAS_MAX ]
# CHECK-MAX-NEXT: Initial: 0x00000004
# CHECK-MAX-NEXT: Maximum: 0x00000005
# CHECK-MAX-NEXT: - Type: