Skip to content

Commit

Permalink
[test] Test cases with imports the same name as exports (WebAssembly#…
Browse files Browse the repository at this point in the history
  • Loading branch information
axic authored and gumb0 committed Mar 4, 2021
1 parent 0e5cd56 commit 060f521
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/core/imports.wast
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,26 @@
"unknown type"
)

;; Export sharing name with import
(module
(import "spectest" "print_i32" (func $imported_print (param i32)))
(func (export "print_i32") (param $i i32)
(call $imported_print (local.get $i))
)
)

(assert_return (invoke "print_i32" (i32.const 13)))

;; Export sharing name with import
(module
(import "spectest" "print_i32" (func $imported_print (param i32)))
(func (export "print_i32") (param $i i32) (param $j i32) (result i32)
(i32.add (local.get $i) (local.get $j))
)
)

(assert_return (invoke "print_i32" (i32.const 5) (i32.const 11)) (i32.const 16))

(module (import "test" "func" (func)))
(module (import "test" "func-i32" (func (param i32))))
(module (import "test" "func-f32" (func (param f32))))
Expand Down

0 comments on commit 060f521

Please sign in to comment.