summaryrefslogtreecommitdiff
path: root/test/lit/wasm-split/name-collision.wast
blob: bb227f41508859cb156ed785149580b91607c0a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
;; Regression test for a bug in which colliding internal names between
;; non-function exports would result in the wrong import names being used in the
;; secondary module.

;; RUN: wasm-split %s -o1 %t.1.wasm -o2 %t.2.wasm --split-funcs=use
;; RUN: wasm-dis %t.2.wasm | filecheck %s

;; CHECK-NOT: (import "primary" "memory" (table
;; CHECK: (import "primary" "table" (table

(module
 (table $collide 1 funcref)
 (memory $collide 1 1)
 (export "table" (table $collide))
 (export "memory" (memory $collide))
 (func $use
  (call_indirect
   (i32.const 0)
  )
  (i32.store
   (i32.const 0)
   (i32.const 0)
  )
 )
 (func $use-use
  (call $use)
 )
)