summaryrefslogtreecommitdiff
path: root/test/lit/wasm-split
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/wasm-split
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/wasm-split')
-rw-r--r--test/lit/wasm-split/jspi-secondary-export.wast43
-rw-r--r--test/lit/wasm-split/jspi.wast4
-rw-r--r--test/lit/wasm-split/multi-memory-lowering-export.wast15
-rw-r--r--test/lit/wasm-split/multi-memory-lowering-import.wast11
4 files changed, 38 insertions, 35 deletions
diff --git a/test/lit/wasm-split/jspi-secondary-export.wast b/test/lit/wasm-split/jspi-secondary-export.wast
index 6bb388fec..57fe849a9 100644
--- a/test/lit/wasm-split/jspi-secondary-export.wast
+++ b/test/lit/wasm-split/jspi-secondary-export.wast
@@ -8,27 +8,6 @@
;; enabled.
(module
- ;; PRIMARY: (type $0 (func (param i32) (result i32)))
-
- ;; PRIMARY: (type $3 (func (param externref)))
-
- ;; PRIMARY: (type $1 (func (param externref i32) (result i32)))
-
- ;; PRIMARY: (type $2 (func))
-
- ;; PRIMARY: (import "env" "__load_secondary_module" (func $import$__load_secondary_module (param externref)))
-
- ;; PRIMARY: (import "placeholder" "0" (func $placeholder_0 (param i32) (result i32)))
-
- ;; PRIMARY: (global $suspender (mut externref) (ref.null noextern))
-
- ;; PRIMARY: (global $global$1 (mut i32) (i32.const 0))
-
- ;; PRIMARY: (table $0 1 funcref)
-
- ;; PRIMARY: (elem $0 (i32.const 0) $placeholder_0)
-
- ;; PRIMARY: (export "foo" (func $export$foo))
(export "foo" (func $foo))
;; SECONDARY: (type $0 (func (param i32) (result i32)))
@@ -47,6 +26,28 @@
(i32.const 0)
)
)
+;; PRIMARY: (type $0 (func (param i32) (result i32)))
+
+;; PRIMARY: (type $3 (func (param externref)))
+
+;; PRIMARY: (type $1 (func (param externref i32) (result i32)))
+
+;; PRIMARY: (type $2 (func))
+
+;; PRIMARY: (import "env" "__load_secondary_module" (func $import$__load_secondary_module (param externref)))
+
+;; PRIMARY: (import "placeholder" "0" (func $placeholder_0 (param i32) (result i32)))
+
+;; PRIMARY: (global $suspender (mut externref) (ref.null noextern))
+
+;; PRIMARY: (global $global$1 (mut i32) (i32.const 0))
+
+;; PRIMARY: (table $0 1 funcref)
+
+;; PRIMARY: (elem $0 (i32.const 0) $placeholder_0)
+
+;; PRIMARY: (export "foo" (func $export$foo))
+
;; PRIMARY: (export "load_secondary_module_status" (global $global$1))
;; PRIMARY: (export "%table" (table $0))
diff --git a/test/lit/wasm-split/jspi.wast b/test/lit/wasm-split/jspi.wast
index b1f1b56f3..340b2acec 100644
--- a/test/lit/wasm-split/jspi.wast
+++ b/test/lit/wasm-split/jspi.wast
@@ -29,11 +29,11 @@
;; PRIMARY: (elem $0 (i32.const 0) $placeholder_0)
;; PRIMARY: (export "foo" (func $export$foo))
- (export "foo" (func $foo))
+
;; PRIMARY: (export "load_secondary_module_status" (global $global$1))
;; PRIMARY: (export "%foo" (func $foo))
-
+ (export "foo" (func $foo))
;; PRIMARY: (export "%table" (table $0))
;; PRIMARY: (export "%global" (global $suspender))
diff --git a/test/lit/wasm-split/multi-memory-lowering-export.wast b/test/lit/wasm-split/multi-memory-lowering-export.wast
index 156ac2efe..0721ba2a4 100644
--- a/test/lit/wasm-split/multi-memory-lowering-export.wast
+++ b/test/lit/wasm-split/multi-memory-lowering-export.wast
@@ -5,17 +5,18 @@
(module
(memory $memory1 1)
(memory $memory2 1 1)
- ;; CHECK: (type $0 (func (result i32)))
+ (export "mem" (memory $memory1))
+)
- ;; CHECK: (type $1 (func (param i32) (result i32)))
+;; CHECK: (type $0 (func (result i32)))
- ;; CHECK: (global $memory2_byte_offset (mut i32) (i32.const 65536))
+;; CHECK: (type $1 (func (param i32) (result i32)))
- ;; CHECK: (memory $combined_memory 1 1)
+;; CHECK: (global $memory2_byte_offset (mut i32) (i32.const 65536))
- ;; CHECK: (export "mem" (memory $combined_memory))
- (export "mem" (memory $memory1))
-)
+;; CHECK: (memory $combined_memory 1 1)
+
+;; CHECK: (export "mem" (memory $combined_memory))
;; CHECK: (func $memory1_size (type $0) (result i32)
;; CHECK-NEXT: (return
diff --git a/test/lit/wasm-split/multi-memory-lowering-import.wast b/test/lit/wasm-split/multi-memory-lowering-import.wast
index e00c13799..d62609108 100644
--- a/test/lit/wasm-split/multi-memory-lowering-import.wast
+++ b/test/lit/wasm-split/multi-memory-lowering-import.wast
@@ -3,15 +3,16 @@
;; RUN: wasm-opt %s --multi-memory-lowering -all -S -o - | filecheck %s
(module
- ;; CHECK: (type $0 (func (result i32)))
-
- ;; CHECK: (type $1 (func (param i32) (result i32)))
-
- ;; CHECK: (import "env" "mem" (memory $combined_memory 2 2))
(import "env" "mem" (memory $memory1 1 1))
(memory $memory2 1 1)
)
+;; CHECK: (type $0 (func (result i32)))
+
+;; CHECK: (type $1 (func (param i32) (result i32)))
+
+;; CHECK: (import "env" "mem" (memory $combined_memory 2 2))
+
;; CHECK: (global $memory2_byte_offset (mut i32) (i32.const 65536))
;; CHECK: (func $memory1_size (type $0) (result i32)