54 lines · plain
1# RUN: split-file %s %t2# RUN: llvm-mc -show-encoding -triple=wasm32-unknown-unknown -mattr=+bulk-memory < %t/wasm32.s | FileCheck %s3# RUN: llvm-mc -show-encoding -triple=wasm64-unknown-unknown -mattr=+bulk-memory < %t/wasm64.s | FileCheck %s4 5#--- wasm32.s6main:7 .functype main () -> ()8 9 i32.const 2 # dest address10 i32.const 3 # src offset11 i32.const 4 # count12 # CHECK: memory.init 3, 0 # encoding: [0xfc,0x08,0x03,0x00]13 memory.init 3, 014 15 # CHECK: data.drop 3 # encoding: [0xfc,0x09,0x03]16 data.drop 317 18 i32.const 2 # dst19 i32.const 3 # src20 i32.const 4 # count21 # CHECK: memory.copy 0, 0 # encoding: [0xfc,0x0a,0x00,0x00]22 memory.copy 0, 023 24 i32.const 2 # addr25 i32.const 3 # val26 i32.const 4 # count27 # CHECK: memory.fill 0 # encoding: [0xfc,0x0b,0x00]28 memory.fill 029 30 end_function31 32#--- wasm64.s33main:34 .functype main () -> ()35 36 i64.const 2 # dest address37 i32.const 3 # src offset38 i32.const 4 # count39 memory.init 3, 040 41 data.drop 342 43 i64.const 2 # dst44 i64.const 3 # src45 i64.const 4 # count46 memory.copy 0, 047 48 i64.const 2 # addr49 i32.const 3 # val50 i64.const 4 # count51 memory.fill 052 53 end_function54