summaryrefslogtreecommitdiff
path: root/test/lit/ctor-eval
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-01-02 12:08:33 -0800
committerGitHub <noreply@github.com>2024-01-02 12:08:33 -0800
commit95ed4f3f0bf0a463cee88a63c5becde4d28692ff (patch)
tree9aa47f97492132f134df4f30c33c7b143a03455b /test/lit/ctor-eval
parent98cef80eabe2171bb3076767d68b25a85d268c12 (diff)
downloadbinaryen-95ed4f3f0bf0a463cee88a63c5becde4d28692ff.tar.gz
binaryen-95ed4f3f0bf0a463cee88a63c5becde4d28692ff.tar.bz2
binaryen-95ed4f3f0bf0a463cee88a63c5becde4d28692ff.zip
Match names more precisely in update_lit_checks.py (#6190)
Previously the lit test update script interpreted module names as the names of import items and export names as the names of export items, but it is more precise to use the actual identifiers of the imported or exported items as the names instead. Update update_lit_checks.py to use a more correct regex to match names and to correctly use the identifiers of import and export items as their names. In some cases this can improve the readability of test output.
Diffstat (limited to 'test/lit/ctor-eval')
-rw-r--r--test/lit/ctor-eval/ctor_after_serialization.wat28
-rw-r--r--test/lit/ctor-eval/extern.wast45
-rw-r--r--test/lit/ctor-eval/table.wat11
-rw-r--r--test/lit/ctor-eval/v128.wast3
4 files changed, 48 insertions, 39 deletions
diff --git a/test/lit/ctor-eval/ctor_after_serialization.wat b/test/lit/ctor-eval/ctor_after_serialization.wat
index 45e811804..df37f7e8b 100644
--- a/test/lit/ctor-eval/ctor_after_serialization.wat
+++ b/test/lit/ctor-eval/ctor_after_serialization.wat
@@ -10,15 +10,7 @@
;; CHECK: (type $A (struct ))
(type $A (struct))
- ;; CHECK: (type $1 (func (result (ref any))))
-
- ;; CHECK: (type $2 (func))
-
- ;; CHECK: (global $ctor-eval$global (ref $A) (struct.new_default $A))
-
- ;; CHECK: (export "new" (func $new_2))
(export "new" (func $new))
- ;; CHECK: (export "nop" (func $nop_3))
(export "nop" (func $nop))
(func $new (result (ref any))
@@ -30,6 +22,16 @@
)
)
+;; CHECK: (type $1 (func (result (ref any))))
+
+;; CHECK: (type $2 (func))
+
+;; CHECK: (global $ctor-eval$global (ref $A) (struct.new_default $A))
+
+;; CHECK: (export "new" (func $new_2))
+
+;; CHECK: (export "nop" (func $nop_3))
+
;; CHECK: (func $new_2 (type $1) (result (ref any))
;; CHECK-NEXT: (global.get $ctor-eval$global)
;; CHECK-NEXT: )
@@ -53,11 +55,7 @@
(struct.new_default $A)
)
- ;; CHECK: (global $ctor-eval$global_1 (ref $A) (struct.new_default $A))
-
- ;; CHECK: (export "new" (func $new_2))
(export "new" (func $new))
- ;; CHECK: (export "nop" (func $nop_3))
(export "nop" (func $nop))
(func $new (result (ref any))
@@ -69,6 +67,12 @@
(global.get $ctor-eval$global)
)
)
+;; CHECK: (global $ctor-eval$global_1 (ref $A) (struct.new_default $A))
+
+;; CHECK: (export "new" (func $new_2))
+
+;; CHECK: (export "nop" (func $nop_3))
+
;; CHECK: (func $new_2 (type $1) (result (ref any))
;; CHECK-NEXT: (global.get $ctor-eval$global_1)
;; CHECK-NEXT: )
diff --git a/test/lit/ctor-eval/extern.wast b/test/lit/ctor-eval/extern.wast
index 5bb5c8cbc..9a8779abf 100644
--- a/test/lit/ctor-eval/extern.wast
+++ b/test/lit/ctor-eval/extern.wast
@@ -8,29 +8,8 @@
;; CHECK: (type $struct (struct (field externref)))
(type $struct (struct (field externref)))
- ;; CHECK: (type $2 (func (result externref)))
-
- ;; CHECK: (type $3 (func (result anyref)))
-
- ;; CHECK: (global $ctor-eval$global (ref $array) (array.new_fixed $array 3
- ;; CHECK-NEXT: (i32.const 1)
- ;; CHECK-NEXT: (i32.const 2)
- ;; CHECK-NEXT: (i32.const 3)
- ;; CHECK-NEXT: ))
-
- ;; CHECK: (global $ctor-eval$global_1 (ref $struct) (struct.new $struct
- ;; CHECK-NEXT: (extern.externalize
- ;; CHECK-NEXT: (ref.i31
- ;; CHECK-NEXT: (i32.const 1)
- ;; CHECK-NEXT: )
- ;; CHECK-NEXT: )
- ;; CHECK-NEXT: ))
-
- ;; CHECK: (export "test1" (func $test1_3))
(export "test1" (func $test1))
- ;; CHECK: (export "test2" (func $test2_4))
(export "test2" (func $test2))
- ;; CHECK: (export "test3" (func $test3_5))
(export "test3" (func $test3))
(func $test1 (result externref)
@@ -70,6 +49,30 @@
)
)
+;; CHECK: (type $2 (func (result externref)))
+
+;; CHECK: (type $3 (func (result anyref)))
+
+;; CHECK: (global $ctor-eval$global (ref $array) (array.new_fixed $array 3
+;; CHECK-NEXT: (i32.const 1)
+;; CHECK-NEXT: (i32.const 2)
+;; CHECK-NEXT: (i32.const 3)
+;; CHECK-NEXT: ))
+
+;; CHECK: (global $ctor-eval$global_1 (ref $struct) (struct.new $struct
+;; CHECK-NEXT: (extern.externalize
+;; CHECK-NEXT: (ref.i31
+;; CHECK-NEXT: (i32.const 1)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: ))
+
+;; CHECK: (export "test1" (func $test1_3))
+
+;; CHECK: (export "test2" (func $test2_4))
+
+;; CHECK: (export "test3" (func $test3_5))
+
;; CHECK: (func $test1_3 (type $2) (result externref)
;; CHECK-NEXT: (extern.externalize
;; CHECK-NEXT: (ref.i31
diff --git a/test/lit/ctor-eval/table.wat b/test/lit/ctor-eval/table.wat
index 73534f59b..0954faeea 100644
--- a/test/lit/ctor-eval/table.wat
+++ b/test/lit/ctor-eval/table.wat
@@ -10,11 +10,6 @@
(elem (i32.const 0) $nop)
- ;; CHECK: (elem $0 (i32.const 0) $nop)
-
- ;; CHECK: (elem declare func $trap)
-
- ;; CHECK: (export "run" (func $run_3))
(export "run" (func $run))
(func $run (type $none_=>_none)
@@ -35,6 +30,12 @@
)
)
+ ;; CHECK: (elem $0 (i32.const 0) $nop)
+
+ ;; CHECK: (elem declare func $trap)
+
+ ;; CHECK: (export "run" (func $run_3))
+
;; CHECK: (func $nop (type $none_=>_none)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: )
diff --git a/test/lit/ctor-eval/v128.wast b/test/lit/ctor-eval/v128.wast
index 03a7bb9d8..009ef57f2 100644
--- a/test/lit/ctor-eval/v128.wast
+++ b/test/lit/ctor-eval/v128.wast
@@ -9,10 +9,11 @@
;; CHECK: (memory $0 (shared 16 17))
(memory $0 (shared 16 17))
+ (export "v128" (func $v128))
;; CHECK: (data $0 (i32.const 23) "\e0\ff\c0N\8e\00\00\fe\01\00\12\81\85\fd\ff\90")
;; CHECK: (export "v128" (func $v128_2))
- (export "v128" (func $v128))
+
;; CHECK: (export "keepalive" (func $keepalive))
(export "keepalive" (func $keepalive))