File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
tests/regression/ba-issues Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
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 ))
Original file line number Diff line number Diff line change 1770
1770
"stdout content" : " " ,
1771
1771
"description" : " no 'invalid local type'"
1772
1772
}
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
+ }
1773
1789
}
1774
1790
]
1775
1791
}
You can’t perform that action at this time.
0 commit comments