1;; 64 => 64
2(module
3  (memory $a i64 1)
4  (memory $b i64 1)
5
6  (func (export "copy") (param i64 i64 i64)
7      local.get 0
8      local.get 1
9      local.get 2
10      memory.copy $a $b)
11)
12(invoke "copy" (i64.const 0) (i64.const 0) (i64.const 100))
13(assert_trap
14  (invoke "copy" (i64.const 0x1_0000_0000) (i64.const 0) (i64.const 0))
15  "out of bounds memory access")
16
17;; 32 => 64
18(module
19  (memory $a i32 1)
20  (memory $b i64 1)
21
22  (func (export "copy") (param i32 i64 i32)
23      local.get 0
24      local.get 1
25      local.get 2
26      memory.copy $a $b)
27)
28(invoke "copy" (i32.const 0) (i64.const 0) (i32.const 100))
29(assert_trap
30  (invoke "copy" (i32.const 0) (i64.const 0x1_0000_0000) (i32.const 0))
31  "out of bounds memory access")
32
33;; 64 => 32
34(module
35  (memory $a i64 1)
36  (memory $b i32 1)
37
38  (func (export "copy") (param i64 i32 i32)
39      local.get 0
40      local.get 1
41      local.get 2
42      memory.copy $a $b)
43)
44(invoke "copy" (i64.const 0) (i32.const 0) (i32.const 100))
45(assert_trap
46  (invoke "copy" (i64.const 0x1_0000_0000) (i32.const 0) (i32.const 0))
47  "out of bounds memory access")
48
49