diff options
Diffstat (limited to 'test/wasm/import-memory.test')
| -rw-r--r-- | test/wasm/import-memory.test | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/test/wasm/import-memory.test b/test/wasm/import-memory.test index 9713e6cd5a173..49bf06b748322 100644 --- a/test/wasm/import-memory.test +++ b/test/wasm/import-memory.test @@ -1,13 +1,33 @@ -# RUN: llc -filetype=obj -mtriple=wasm32-unknown-unknown-wasm %p/Inputs/ret32.ll -o %t.ret32.o -# RUN: lld -flavor wasm -entry ret32 --import-memory -o %t.wasm %t.ret32.o +# 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: Imports: # CHECK-NEXT: - Module: env # CHECK-NEXT: Field: memory # CHECK-NEXT: Kind: MEMORY -# CHECK-NEXT: 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: |
