Skip to content

Commit 387c10b

Browse files
committed
Add regression test
1 parent a6a9f1f commit 387c10b

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
@@ -1754,6 +1754,22 @@
17541754
"stdout content": "",
17551755
"description": "no sanitizer 'heap-buffer-overflow'"
17561756
}
1757+
},
1758+
{
1759+
"deprecated": false,
1760+
"ids": [
1761+
4644
1762+
],
1763+
"runtime": "iwasm-default-gc-enabled",
1764+
"file": "test.wasm",
1765+
"mode": "classic-interp",
1766+
"options": "-f _start",
1767+
"argument": "",
1768+
"expected return": {
1769+
"ret code": 0,
1770+
"stdout content": "",
1771+
"description": "no out of bound exception"
1772+
}
17571773
}
17581774
]
17591775
}

0 commit comments

Comments
 (0)