diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/merge/names.wat | 137 | ||||
-rw-r--r-- | test/lit/merge/names.wat.second | 27 | ||||
-rw-r--r-- | test/passes/func-metrics.txt | 4 | ||||
-rw-r--r-- | test/unit/input/gc_target_feature.wasm | bin | 94 -> 91 bytes |
4 files changed, 166 insertions, 2 deletions
diff --git a/test/lit/merge/names.wat b/test/lit/merge/names.wat new file mode 100644 index 000000000..24b1dab0d --- /dev/null +++ b/test/lit/merge/names.wat @@ -0,0 +1,137 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. +;; RUN: wasm-merge -g %s first %s.second second -all -o %t.wasm +;; RUN: wasm-opt -all %t.wasm -S -o - | filecheck %s +(module + ;; CHECK: (type $0 (func)) + + ;; CHECK: (type $t (struct (field $a i32) (field $b i32))) + + ;; CHECK: (type $2 (func (param (ref $t)))) + + ;; CHECK: (type $u (struct (field $c i64) (field $d i32))) + + ;; CHECK: (type $4 (func (param (ref $u)))) + + ;; CHECK: (global $global$0 i32 (i32.const 0)) + + ;; CHECK: (global $glob2 i32 (i32.const 0)) + + ;; CHECK: (global $global$2 i32 (i32.const 0)) + + ;; CHECK: (global $glob0 i32 (i32.const 0)) + + ;; CHECK: (memory $mem0 0) + + ;; CHECK: (memory $1 0) + + ;; CHECK: (memory $mem2 0) + + ;; CHECK: (memory $3 0) + + ;; CHECK: (table $table0 1 funcref) + + ;; CHECK: (table $1 1 funcref) + + ;; CHECK: (table $table2 1 funcref) + + ;; CHECK: (table $3 1 funcref) + + ;; CHECK: (tag $tag0) + + ;; CHECK: (tag $tag$1) + + ;; CHECK: (tag $tag2) + + ;; CHECK: (tag $tag$3) + + ;; CHECK: (export "m0" (memory $mem0)) + + ;; CHECK: (export "m1" (memory $1)) + + ;; CHECK: (export "f0" (func $func0)) + + ;; CHECK: (export "f1" (func $1)) + + ;; CHECK: (export "t0" (table $table0)) + + ;; CHECK: (export "t1" (table $1)) + + ;; CHECK: (export "g0" (global $glob0)) + + ;; CHECK: (export "g1" (global $global$2)) + + ;; CHECK: (export "tag0" (tag $tag0)) + + ;; CHECK: (export "tag1" (tag $tag$1)) + + ;; CHECK: (export "func" (func $2)) + + ;; CHECK: (export "m2" (memory $mem2)) + + ;; CHECK: (export "m3" (memory $3)) + + ;; CHECK: (export "f2" (func $func2)) + + ;; CHECK: (export "f3" (func $4)) + + ;; CHECK: (export "t2" (table $table2)) + + ;; CHECK: (export "t3" (table $3)) + + ;; CHECK: (export "g2" (global $glob2)) + + ;; CHECK: (export "g3" (global $global$0)) + + ;; CHECK: (export "tag2" (tag $tag2)) + + ;; CHECK: (export "tag3" (tag $tag$3)) + + ;; CHECK: (export "func2" (func $5)) + + ;; CHECK: (func $func0 (type $0) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + (func $func0 (export "f0")) + (func (export "f1")) + + (table $table0 (export "t0") 1 funcref) + (table (export "t1") 1 funcref) + + (global $glob0 (export g0) i32 (i32.const 0)) + (global (export g1) i32 (i32.const 0)) + + (memory $mem0 (export "m0") 0) + (memory (export "m1") 0) + + (elem $elem0 func) + (elem func) + + (data $data0 "") + (data "") + + (tag $tag0 (export tag0)) + (tag (export tag1)) + + (type $t (struct (field $a i32) (field $b i32))) + + (func (export "func") (param $x (ref $t))) +) +;; CHECK: (func $1 (type $0) +;; CHECK-NEXT: (nop) +;; CHECK-NEXT: ) + +;; CHECK: (func $2 (type $2) (param $x (ref $t)) +;; CHECK-NEXT: (nop) +;; CHECK-NEXT: ) + +;; CHECK: (func $func2 (type $0) +;; CHECK-NEXT: (nop) +;; CHECK-NEXT: ) + +;; CHECK: (func $4 (type $0) +;; CHECK-NEXT: (nop) +;; CHECK-NEXT: ) + +;; CHECK: (func $5 (type $4) (param $0 (ref $u)) +;; CHECK-NEXT: (nop) +;; CHECK-NEXT: ) diff --git a/test/lit/merge/names.wat.second b/test/lit/merge/names.wat.second new file mode 100644 index 000000000..4aed55d53 --- /dev/null +++ b/test/lit/merge/names.wat.second @@ -0,0 +1,27 @@ +(module + + (func $func2 (export "f2")) + (func (export "f3")) + + (table $table2 (export "t2") 1 funcref) + (table (export "t3") 1 funcref) + + (memory $mem2 (export "m2") 0) + (memory (export "m3") 0) + + (global $glob2 (export g2) i32 (i32.const 0)) + (global (export g3) i32 (i32.const 0)) + + (elem $elem2 func) + (elem func) + + (data $data2 "") + (data "") + + (tag $tag2 (export tag2)) + (tag (export tag3)) + + (type $u (struct (field $c i64) (field $d i32))) + + (func (export "func2") (param (ref $u))) +) diff --git a/test/passes/func-metrics.txt b/test/passes/func-metrics.txt index 69b89557c..8921b6977 100644 --- a/test/passes/func-metrics.txt +++ b/test/passes/func-metrics.txt @@ -244,7 +244,7 @@ func: func_a Block : 1 Call : 5 start: func_a - [removable-bytes-without-it]: 57 + [removable-bytes-without-it]: 60 [total] : 0 (module (type $0 (func)) @@ -274,7 +274,7 @@ func: 0 [vars] : 0 GlobalGet : 1 export: stackSave (0) - [removable-bytes-without-it]: 62 + [removable-bytes-without-it]: 79 [total] : 0 (module (type $0 (func (result i32))) diff --git a/test/unit/input/gc_target_feature.wasm b/test/unit/input/gc_target_feature.wasm Binary files differindex bf2ecf934..8fab7a31a 100644 --- a/test/unit/input/gc_target_feature.wasm +++ b/test/unit/input/gc_target_feature.wasm |