Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions test/lit/passes/duplicate-import-elimination.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up.

;; RUN: foreach %s %t wasm-opt --duplicate-import-elimination -S -o - | filecheck %s

(module
;; CHECK: (type $0 (func))

;; CHECK: (type $1 (func (param i32)))

;; CHECK: (import "env" "waka" (func $foo))
(import "env" "waka" (func $foo))
(import "env" "waka" (func $bar))
;; CHECK: (import "env" "waka" (func $wrong (param i32)))
(import "env" "waka" (func $wrong (param i32)))
(table 2 2 funcref)
(elem (i32.const 0) $foo $bar)
(start $bar)
;; CHECK: (table $0 2 2 funcref)

;; CHECK: (elem $0 (i32.const 0) $foo $foo)

;; CHECK: (export "baz" (func $baz))

;; CHECK: (start $foo)

;; CHECK: (func $baz
;; CHECK-NEXT: (call $foo)
;; CHECK-NEXT: (call $foo)
;; CHECK-NEXT: (call $wrong
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $baz (export "baz")
(call $foo)
(call $bar)
(call $wrong (i32.const 1))
)
)
63 changes: 63 additions & 0 deletions test/lit/passes/fpcast-emu_pass-arg=max-func-params@5.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up.

;; RUN: foreach %s %t wasm-opt --fpcast-emu --pass-arg=max-func-params@5 -S -o - | filecheck %s

(module
;; CHECK: (type $0 (func (param i64 i64 i64 i64 i64) (result i64)))

;; CHECK: (type $vijfd (func (param i32 i64 f32 f64)))
(type $vijfd (func (param i32) (param i64) (param f32) (param f64)))
(table 10 10 funcref)
(elem (i32.const 0) $a)
;; CHECK: (table $0 10 10 funcref)

;; CHECK: (elem $0 (i32.const 0) $byn$fpcast-emu$a)

;; CHECK: (func $a (param $x i32) (param $y i64) (param $z f32) (param $w f64)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (call_indirect (type $0)
;; CHECK-NEXT: (i64.extend_i32_u
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (i64.const 2)
;; CHECK-NEXT: (i64.extend_i32_u
;; CHECK-NEXT: (i32.reinterpret_f32
;; CHECK-NEXT: (f32.const 3)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (i64.reinterpret_f64
;; CHECK-NEXT: (f64.const 4)
;; CHECK-NEXT: )
;; CHECK-NEXT: (i64.const 0)
;; CHECK-NEXT: (i32.const 1337)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $a (param $x i32) (param $y i64) (param $z f32) (param $w f64)
(call_indirect (type $vijfd)
(i32.const 1)
(i64.const 2)
(f32.const 3)
(f64.const 4)
(i32.const 1337)
)
)
)
;; CHECK: (func $byn$fpcast-emu$a (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (result i64)
;; CHECK-NEXT: (call $a
;; CHECK-NEXT: (i32.wrap_i64
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: (f32.reinterpret_i32
;; CHECK-NEXT: (i32.wrap_i64
;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (f64.reinterpret_i64
;; CHECK-NEXT: (local.get $3)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (i64.const 0)
;; CHECK-NEXT: )
Loading
Loading