summaryrefslogtreecommitdiff
path: root/test/lit/binary/duplicated_names_collision.test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2024-07-31 10:16:36 -0700
committerGitHub <noreply@github.com>2024-07-31 10:16:36 -0700
commitc68978114ccb12a6cef8ba5651ef3e0deb03f879 (patch)
treeae0c802c882bd4ebc2f50bd63df2d14252dc3f81 /test/lit/binary/duplicated_names_collision.test
parente6bbff7846cad9daf178b6917d78abe5cfcd5771 (diff)
downloadbinaryen-c68978114ccb12a6cef8ba5651ef3e0deb03f879.tar.gz
binaryen-c68978114ccb12a6cef8ba5651ef3e0deb03f879.tar.bz2
binaryen-c68978114ccb12a6cef8ba5651ef3e0deb03f879.zip
Use Names::getValidNameGivenExisting in binary reading (#6793)
We had a TODO to use it once Names was optimized, which it has been. The Names version is also far faster. When building https://github.com/JetBrains/kotlinconf-app it saves 70 seconds(!).
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: )