summaryrefslogtreecommitdiff
path: root/test/lit
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit')
-rw-r--r--test/lit/binary/duplicated_names_collision.test21
-rw-r--r--test/lit/binary/duplicated_names_collision.test.wasmbin0 -> 66 bytes
-rw-r--r--test/lit/binary/duplicated_names_collision_underscore.test21
-rw-r--r--test/lit/binary/duplicated_names_collision_underscore.test.wasmbin0 -> 66 bytes
-rw-r--r--test/lit/binary/name-overlap.test5
5 files changed, 45 insertions, 2 deletions
diff --git a/test/lit/binary/duplicated_names_collision.test b/test/lit/binary/duplicated_names_collision.test
new file mode 100644
index 000000000..ce0df6ca5
--- /dev/null
+++ b/test/lit/binary/duplicated_names_collision.test
@@ -0,0 +1,21 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; RUN: wasm-opt %s.wasm -S -o - | filecheck %s
+
+;; Test handling of duplicated names where the name in the binary format
+;; overlaps with the suffix we add to deduplicate. The binary here uses a '.'
+;; in one of the names, which will overlap if we use '.2' etc. to differentiate.
+
+
+;; CHECK: (type $0 (func (result i32)))
+
+;; CHECK: (func $foo (result i32)
+;; CHECK-NEXT: (i32.const 0)
+;; CHECK-NEXT: )
+
+;; CHECK: (func $foo_1 (result i32)
+;; CHECK-NEXT: (i32.const 1)
+;; CHECK-NEXT: )
+
+;; CHECK: (func $foo.1 (result i32)
+;; CHECK-NEXT: (i32.const 2)
+;; CHECK-NEXT: )
diff --git a/test/lit/binary/duplicated_names_collision.test.wasm b/test/lit/binary/duplicated_names_collision.test.wasm
new file mode 100644
index 000000000..b742ce07a
--- /dev/null
+++ b/test/lit/binary/duplicated_names_collision.test.wasm
Binary files differ
diff --git a/test/lit/binary/duplicated_names_collision_underscore.test b/test/lit/binary/duplicated_names_collision_underscore.test
new file mode 100644
index 000000000..f4f4e56ee
--- /dev/null
+++ b/test/lit/binary/duplicated_names_collision_underscore.test
@@ -0,0 +1,21 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; RUN: wasm-opt %s.wasm -S -o - | filecheck %s
+
+;; Test handling of duplicated names where the name in the binary format
+;; overlaps with the suffix we add to deduplicate. This is similar to
+;; the non-underscore version of this test, but has an '_' in the name.
+
+
+;; CHECK: (type $0 (func (result i32)))
+
+;; CHECK: (func $foo (result i32)
+;; CHECK-NEXT: (i32.const 0)
+;; CHECK-NEXT: )
+
+;; CHECK: (func $foo_1 (result i32)
+;; CHECK-NEXT: (i32.const 1)
+;; CHECK-NEXT: )
+
+;; CHECK: (func $foo_1_2 (result i32)
+;; CHECK-NEXT: (i32.const 2)
+;; CHECK-NEXT: )
diff --git a/test/lit/binary/duplicated_names_collision_underscore.test.wasm b/test/lit/binary/duplicated_names_collision_underscore.test.wasm
new file mode 100644
index 000000000..facbee0d8
--- /dev/null
+++ b/test/lit/binary/duplicated_names_collision_underscore.test.wasm
Binary files differ
diff --git a/test/lit/binary/name-overlap.test b/test/lit/binary/name-overlap.test
index 7f5318737..f5c47e50a 100644
--- a/test/lit/binary/name-overlap.test
+++ b/test/lit/binary/name-overlap.test
@@ -17,6 +17,7 @@
;; that we leave the name from the names section as it is, and only adjust the
;; temp name.)
-;; CHECK: (global $global$1 i32 (i32.const 1))
-;; CHECK-NEXT: (global $global$1.1 i32 (i32.const 0))
+;; CHECK: (global $global$1 i32 (i32.const 1))
+
+;; CHECK: (global $global$1_1 i32 (i32.const 0))