summaryrefslogtreecommitdiff
path: root/test/lit/binary/duplicated_names_collision.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/binary/duplicated_names_collision.test')
-rw-r--r--test/lit/binary/duplicated_names_collision.test21
1 files changed, 21 insertions, 0 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: )