mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 23:15:16 +00:00
16a4d71b34
Implement the GC (Garbage Collection) feature for interpreter mode, AOT mode and LLVM-JIT mode, and support most features of the latest spec proposal, and also enable the stringref feature. Use `cmake -DWAMR_BUILD_GC=1/0` to enable/disable the feature, and `wamrc --enable-gc` to generate the AOT file with GC supported. And update the AOT file version from 2 to 3 since there are many AOT ABI breaks, including the changes of AOT file format, the changes of AOT module/memory instance layouts, the AOT runtime APIs for the AOT code to invoke and so on.
266 lines
6.9 KiB
Diff
266 lines
6.9 KiB
Diff
diff --git a/test/core/atomic_wait_notify.wast b/test/core/atomic_wait_notify.wast
|
|
index 2e312c3..4f35ac5 100644
|
|
--- a/test/core/atomic_wait_notify.wast
|
|
+++ b/test/core/atomic_wait_notify.wast
|
|
@@ -70,6 +70,7 @@
|
|
(memory (export "shared") 1 1 shared)
|
|
)
|
|
|
|
+(;
|
|
(thread $T1 (shared (module $Mem))
|
|
(register "mem" $Mem)
|
|
(module
|
|
@@ -106,3 +107,4 @@
|
|
|
|
(wait $T1)
|
|
(wait $T2)
|
|
+;)
|
|
diff --git a/test/core/binary.wast b/test/core/binary.wast
|
|
index b9fa438..a5711dd 100644
|
|
--- a/test/core/binary.wast
|
|
+++ b/test/core/binary.wast
|
|
@@ -45,7 +45,7 @@
|
|
(assert_malformed (module binary "\00asm\00\00\00\01") "unknown binary version")
|
|
|
|
;; Invalid section id.
|
|
-(assert_malformed (module binary "\00asm" "\01\00\00\00" "\0c\00") "malformed section id")
|
|
+;; (assert_malformed (module binary "\00asm" "\01\00\00\00" "\0c\00") "malformed section id")
|
|
(assert_malformed (module binary "\00asm" "\01\00\00\00" "\7f\00") "malformed section id")
|
|
(assert_malformed (module binary "\00asm" "\01\00\00\00" "\80\00\01\00") "malformed section id")
|
|
(assert_malformed (module binary "\00asm" "\01\00\00\00" "\81\00\01\00") "malformed section id")
|
|
@@ -68,7 +68,7 @@
|
|
"\01" ;; call_indirect reserved byte is not equal to zero!
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
;; call_indirect reserved byte should not be a "long" LEB128 zero.
|
|
@@ -87,7 +87,7 @@
|
|
"\80\00" ;; call_indirect reserved byte
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
;; Same as above for 3, 4, and 5-byte zero encodings.
|
|
@@ -106,7 +106,7 @@
|
|
"\80\80\00" ;; call_indirect reserved byte
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
(assert_malformed
|
|
@@ -124,7 +124,7 @@
|
|
"\80\80\80\00" ;; call_indirect reserved byte
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
(assert_malformed
|
|
@@ -142,7 +142,7 @@
|
|
"\80\80\80\80\00" ;; call_indirect reserved byte
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
;; memory.grow reserved byte equal to zero.
|
|
@@ -162,7 +162,7 @@
|
|
"\1a" ;; drop
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
;; memory.grow reserved byte should not be a "long" LEB128 zero.
|
|
@@ -182,7 +182,7 @@
|
|
"\1a" ;; drop
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
;; Same as above for 3, 4, and 5-byte zero encodings.
|
|
@@ -202,7 +202,7 @@
|
|
"\1a" ;; drop
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
(assert_malformed
|
|
@@ -221,7 +221,7 @@
|
|
"\1a" ;; drop
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
(assert_malformed
|
|
@@ -240,7 +240,7 @@
|
|
"\1a" ;; drop
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
;; memory.size reserved byte equal to zero.
|
|
@@ -259,7 +259,7 @@
|
|
"\1a" ;; drop
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
;; memory.size reserved byte should not be a "long" LEB128 zero.
|
|
@@ -278,7 +278,7 @@
|
|
"\1a" ;; drop
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
;; Same as above for 3, 4, and 5-byte zero encodings.
|
|
@@ -297,7 +297,7 @@
|
|
"\1a" ;; drop
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
(assert_malformed
|
|
@@ -315,7 +315,7 @@
|
|
"\1a" ;; drop
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
(assert_malformed
|
|
@@ -333,7 +333,7 @@
|
|
"\1a" ;; drop
|
|
"\0b" ;; end
|
|
)
|
|
- "zero flag expected"
|
|
+ "zero byte expected"
|
|
)
|
|
|
|
;; No more than 2^32 locals.
|
|
@@ -745,6 +745,7 @@
|
|
)
|
|
|
|
;; 2 elem segment declared, 1 given
|
|
+(;
|
|
(assert_malformed
|
|
(module binary
|
|
"\00asm" "\01\00\00\00"
|
|
@@ -761,6 +762,7 @@
|
|
)
|
|
"unexpected end"
|
|
)
|
|
+;)
|
|
|
|
;; 1 elem segment declared, 2 given
|
|
(assert_malformed
|
|
diff --git a/test/core/elem.wast b/test/core/elem.wast
|
|
index 1ea2b06..8eded37 100644
|
|
--- a/test/core/elem.wast
|
|
+++ b/test/core/elem.wast
|
|
@@ -12,10 +12,10 @@
|
|
(elem 0x0 (i32.const 0) $f $f)
|
|
(elem 0x000 (offset (i32.const 0)))
|
|
(elem 0 (offset (i32.const 0)) $f $f)
|
|
- (elem $t (i32.const 0))
|
|
- (elem $t (i32.const 0) $f $f)
|
|
- (elem $t (offset (i32.const 0)))
|
|
- (elem $t (offset (i32.const 0)) $f $f)
|
|
+ (elem (i32.const 0))
|
|
+ (elem (i32.const 0) $f $f)
|
|
+ (elem (offset (i32.const 0)))
|
|
+ (elem (offset (i32.const 0)) $f $f)
|
|
)
|
|
|
|
;; Basic use
|
|
@@ -354,6 +354,7 @@
|
|
(assert_return (invoke $module1 "call-8") (i32.const 65))
|
|
(assert_return (invoke $module1 "call-9") (i32.const 66))
|
|
|
|
+(;
|
|
(module $module2
|
|
(type $out-i32 (func (result i32)))
|
|
(import "module1" "shared-table" (table 10 funcref))
|
|
@@ -379,3 +380,4 @@
|
|
(assert_return (invoke $module1 "call-7") (i32.const 67))
|
|
(assert_return (invoke $module1 "call-8") (i32.const 69))
|
|
(assert_return (invoke $module1 "call-9") (i32.const 70))
|
|
+;)
|
|
diff --git a/test/core/table.wast b/test/core/table.wast
|
|
index 0bc43ca6..ee5209ec 100644
|
|
--- a/test/core/table.wast
|
|
+++ b/test/core/table.wast
|
|
@@ -8,8 +8,8 @@
|
|
(module (table 0 65536 funcref))
|
|
(module (table 0 0xffff_ffff funcref))
|
|
|
|
-(assert_invalid (module (table 0 funcref) (table 0 funcref)) "multiple tables")
|
|
-(assert_invalid (module (table (import "spectest" "table") 0 funcref) (table 0 funcref)) "multiple tables")
|
|
+(module (table 0 funcref) (table 0 funcref))
|
|
+(module (table (import "spectest" "table") 0 funcref) (table 0 funcref))
|
|
|
|
(assert_invalid (module (elem (i32.const 0))) "unknown table")
|
|
(assert_invalid (module (elem (i32.const 0) $f) (func $f)) "unknown table")
|
|
diff --git a/test/core/thread.wast b/test/core/thread.wast
|
|
index c3456a6..83fc281 100644
|
|
--- a/test/core/thread.wast
|
|
+++ b/test/core/thread.wast
|
|
@@ -2,6 +2,7 @@
|
|
(memory (export "shared") 1 1 shared)
|
|
)
|
|
|
|
+(;
|
|
(thread $T1 (shared (module $Mem))
|
|
(register "mem" $Mem)
|
|
(module
|
|
@@ -26,3 +27,4 @@
|
|
|
|
(wait $T1)
|
|
(wait $T2)
|
|
+;)
|
|
diff --git a/test/core/unreached-invalid.wast b/test/core/unreached-invalid.wast
|
|
index 6ef4ac55..9a2387a3 100644
|
|
--- a/test/core/unreached-invalid.wast
|
|
+++ b/test/core/unreached-invalid.wast
|
|
@@ -535,6 +535,7 @@
|
|
))
|
|
"type mismatch"
|
|
)
|
|
+(; invalid case, the module is fine for the latest spec interpreter
|
|
(assert_invalid
|
|
(module (func $type-br_table-label-num-vs-label-num-after-unreachable
|
|
(block (result f64)
|
|
@@ -549,6 +550,7 @@
|
|
))
|
|
"type mismatch"
|
|
)
|
|
+;)
|
|
|
|
(assert_invalid
|
|
(module (func $type-block-value-nested-unreachable-num-vs-void
|