Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / WebAssembly / bulk-memory-encodings.s
blobc9af1af24a3564bf706f766ec899edfcafdece8b
1 # RUN: split-file %s %t
2 # RUN: llvm-mc -show-encoding -triple=wasm32-unknown-unknown -mattr=+bulk-memory < %t/wasm32.s | FileCheck %s
3 # RUN: llvm-mc -show-encoding -triple=wasm64-unknown-unknown -mattr=+bulk-memory < %t/wasm64.s | FileCheck %s
5 #--- wasm32.s
6 main:
7 .functype main () -> ()
9 i32.const 2 # dest address
10 i32.const 3 # src offset
11 i32.const 4 # count
12 # CHECK: memory.init 3, 0 # encoding: [0xfc,0x08,0x03,0x00]
13 memory.init 3, 0
15 # CHECK: data.drop 3 # encoding: [0xfc,0x09,0x03]
16 data.drop 3
18 i32.const 2 # dst
19 i32.const 3 # src
20 i32.const 4 # count
21 # CHECK: memory.copy 0, 0 # encoding: [0xfc,0x0a,0x00,0x00]
22 memory.copy 0, 0
24 i32.const 2 # addr
25 i32.const 3 # val
26 i32.const 4 # count
27 # CHECK: memory.fill 0 # encoding: [0xfc,0x0b,0x00]
28 memory.fill 0
30 end_function
32 #--- wasm64.s
33 main:
34 .functype main () -> ()
36 i64.const 2 # dest address
37 i32.const 3 # src offset
38 i32.const 4 # count
39 memory.init 3, 0
41 data.drop 3
43 i64.const 2 # dst
44 i64.const 3 # src
45 i64.const 4 # count
46 memory.copy 0, 0
48 i64.const 2 # addr
49 i32.const 3 # val
50 i64.const 4 # count
51 memory.fill 0
53 end_function