Skip to content

Commit 36e62ad

Browse files
committed
Add regression test
1 parent 3f4145e commit 36e62ad

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed
76 Bytes
Binary file not shown.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
;; 定义数组类型 - i32数组
2+
(type $i32_array (array (mut i32)))
3+
4+
;; main函数
5+
(func $main
6+
(local $arr (ref $i32_array))
7+
8+
;; 创建一个大小为10的i32数组,初始值为0
9+
(array.new $i32_array
10+
(i32.const 0) ;; 初始值
11+
(i32.const 10)) ;; 数组大小
12+
(local.set $arr)
13+
14+
;; 使用 array.fill 填充数组
15+
(array.fill $i32_array
16+
(local.get $arr) ;; 数组引用
17+
(i32.const 0) ;; 起始索引
18+
(i32.const 42) ;; 填充值
19+
(i32.const 10)) ;; 填充长度 - 填满整个数组
20+
)
21+
22+
(memory 1)
23+
(export "memory" (memory 0))
24+
(export "_start" (func $main))

tests/regression/ba-issues/running_config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,6 +1770,22 @@
17701770
"stdout content": "",
17711771
"description": "no 'invalid local type'"
17721772
}
1773+
},
1774+
{
1775+
"deprecated": false,
1776+
"ids": [
1777+
4644
1778+
],
1779+
"runtime": "iwasm-default-gc-enabled",
1780+
"file": "test.wasm",
1781+
"mode": "classic-interp",
1782+
"options": "-f _start",
1783+
"argument": "",
1784+
"expected return": {
1785+
"ret code": 0,
1786+
"stdout content": "",
1787+
"description": "no out of bound exception"
1788+
}
17731789
}
17741790
]
17751791
}

0 commit comments

Comments
 (0)