summaryrefslogtreecommitdiff
path: root/test/lit/passes/dae-optimizing.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes/dae-optimizing.wast')
-rw-r--r--test/lit/passes/dae-optimizing.wast108
1 files changed, 108 insertions, 0 deletions
diff --git a/test/lit/passes/dae-optimizing.wast b/test/lit/passes/dae-optimizing.wast
new file mode 100644
index 000000000..6b9e610d9
--- /dev/null
+++ b/test/lit/passes/dae-optimizing.wast
@@ -0,0 +1,108 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; NOTE: This test was ported using port_test.py and could be cleaned up.
+
+;; RUN: foreach %s %t wasm-opt --dae-optimizing -S -o - | filecheck %s
+
+(module
+ (type $0 (func (param f32) (result f32)))
+ (type $1 (func (param f64 f32 f32 f64 f32 i64 f64) (result i32)))
+ ;; CHECK: (type $none_=>_i32 (func (result i32)))
+
+ ;; CHECK: (type $none_=>_f32 (func (result f32)))
+
+ ;; CHECK: (type $2 (func (param f64 f32 f32 f64 f32 i32 i32 f64) (result i32)))
+ (type $2 (func (param f64 f32 f32 f64 f32 i32 i32 f64) (result i32)))
+ ;; CHECK: (global $global$0 (mut i32) (i32.const 10))
+ (global $global$0 (mut i32) (i32.const 10))
+ ;; CHECK: (func $0 (result i32)
+ ;; CHECK-NEXT: (local $0 i32)
+ ;; CHECK-NEXT: (local $1 i32)
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (if (result f32)
+ ;; CHECK-NEXT: (local.tee $0
+ ;; CHECK-NEXT: (i32.const 33554432)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (loop $label$2 (result f32)
+ ;; CHECK-NEXT: (if
+ ;; CHECK-NEXT: (global.get $global$0)
+ ;; CHECK-NEXT: (return
+ ;; CHECK-NEXT: (local.get $0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $0
+ ;; CHECK-NEXT: (local.get $1)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $1
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (br_if $label$2
+ ;; CHECK-NEXT: (local.get $0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (f32.const 1)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $1)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.const -11)
+ ;; CHECK-NEXT: )
+ (func $0 (; 0 ;) (type $1) (param $0 f64) (param $1 f32) (param $2 f32) (param $3 f64) (param $4 f32) (param $5 i64) (param $6 f64) (result i32)
+ (local $7 i32)
+ (local $8 i32)
+ (if
+ (local.tee $7
+ (i32.const 33554432)
+ )
+ (drop
+ (loop $label$2 (result f32)
+ (if
+ (global.get $global$0)
+ (return
+ (local.get $7)
+ )
+ )
+ (local.set $8
+ (block $label$4 (result i32)
+ (drop
+ (local.tee $7
+ (local.get $8)
+ )
+ )
+ (i32.const 0)
+ )
+ )
+ (br_if $label$2
+ (local.get $7)
+ )
+ (f32.const 1)
+ )
+ )
+ (drop
+ (call $1
+ (f32.const 1)
+ )
+ )
+ )
+ (i32.const -11)
+ )
+ ;; CHECK: (func $1 (result f32)
+ ;; CHECK-NEXT: (f32.const 0)
+ ;; CHECK-NEXT: )
+ (func $1 (; 1 ;) (type $0) (param $0 f32) (result f32)
+ (f32.const 0)
+ )
+ ;; CHECK: (func $2 (param $0 f64) (param $1 f32) (param $2 f32) (param $3 f64) (param $4 f32) (param $5 i32) (param $6 i32) (param $7 f64) (result i32)
+ ;; CHECK-NEXT: (call $0)
+ ;; CHECK-NEXT: )
+ (func $2 (; 2 ;) (type $2) (param $0 f64) (param $1 f32) (param $2 f32) (param $3 f64) (param $4 f32) (param $5 i32) (param $6 i32) (param $7 f64) (result i32)
+ (call $0
+ (f64.const 1)
+ (f32.const 1)
+ (f32.const 1)
+ (f64.const 1)
+ (f32.const 1)
+ (i64.const 1)
+ (f64.const 1)
+ )
+ )
+)
+