summaryrefslogtreecommitdiff
path: root/test/lit/merge/start.wat
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/merge/start.wat')
-rw-r--r--test/lit/merge/start.wat33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/lit/merge/start.wat b/test/lit/merge/start.wat
new file mode 100644
index 000000000..19a9bcb91
--- /dev/null
+++ b/test/lit/merge/start.wat
@@ -0,0 +1,33 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; RUN: wasm-merge %s first %s.second second --rename-export-conflicts -all -S -o - | filecheck %s
+
+;; Test that we merge start functions. The first module here has none, but the
+;; second does, so we'll refer to its start function in the merged module.
+
+(module
+ (func $start
+ ;; This function has the name start, but is *not* the start function. The
+ ;; other module's start will need to get a new deduplicated name.
+ (drop
+ (i32.const 0)
+ )
+ )
+)
+;; CHECK: (type $none_=>_none (func))
+
+;; CHECK: (export "start" (func $start_1))
+
+;; CHECK: (export "user" (func $user))
+
+;; CHECK: (start $start_1)
+
+;; CHECK: (func $start_1 (type $none_=>_none)
+;; CHECK-NEXT: (drop
+;; CHECK-NEXT: (i32.const 1)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+
+;; CHECK: (func $user (type $none_=>_none)
+;; CHECK-NEXT: (call $start_1)
+;; CHECK-NEXT: (call $start_1)
+;; CHECK-NEXT: )