summaryrefslogtreecommitdiff
path: root/test/lit
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit')
-rw-r--r--test/lit/passes/code-folding.wast (renamed from test/lit/passes/code-folding_enable-threads.wast)63
1 files changed, 51 insertions, 12 deletions
diff --git a/test/lit/passes/code-folding_enable-threads.wast b/test/lit/passes/code-folding.wast
index b07000278..358167481 100644
--- a/test/lit/passes/code-folding_enable-threads.wast
+++ b/test/lit/passes/code-folding.wast
@@ -1,7 +1,7 @@
;; 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 --code-folding --enable-threads -S -o - | filecheck %s
+;; RUN: foreach %s %t wasm-opt -all --code-folding -S -o - | filecheck %s
(module
;; CHECK: (type $0 (func))
@@ -15,13 +15,13 @@
(memory $0 1 1)
;; CHECK: (table $0 282 282 funcref)
- ;; CHECK: (func $0
+ ;; CHECK: (func $0 (type $0)
;; CHECK-NEXT: (block $label$1
;; CHECK-NEXT: (if
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: (then
;; CHECK-NEXT: (block $label$3
- ;; CHECK-NEXT: (call_indirect (type $13)
+ ;; CHECK-NEXT: (call_indirect $0 (type $13)
;; CHECK-NEXT: (block $label$4
;; CHECK-NEXT: (br $label$3)
;; CHECK-NEXT: )
@@ -52,7 +52,7 @@
)
)
)
- ;; CHECK: (func $negative-zero (result f32)
+ ;; CHECK: (func $negative-zero (type $1) (result f32)
;; CHECK-NEXT: (if (result f32)
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: (then
@@ -82,7 +82,7 @@
)
)
)
- ;; CHECK: (func $negative-zero-b (result f32)
+ ;; CHECK: (func $negative-zero-b (type $1) (result f32)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: )
@@ -105,7 +105,7 @@
)
)
)
- ;; CHECK: (func $negative-zero-c (result f32)
+ ;; CHECK: (func $negative-zero-c (type $1) (result f32)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: )
@@ -128,7 +128,7 @@
)
)
)
- ;; CHECK: (func $break-target-outside-of-return-merged-code
+ ;; CHECK: (func $break-target-outside-of-return-merged-code (type $0)
;; CHECK-NEXT: (block $label$A
;; CHECK-NEXT: (if
;; CHECK-NEXT: (unreachable)
@@ -202,7 +202,7 @@
)
)
)
- ;; CHECK: (func $break-target-inside-all-good
+ ;; CHECK: (func $break-target-inside-all-good (type $0)
;; CHECK-NEXT: (block $folding-inner0
;; CHECK-NEXT: (block $label$A
;; CHECK-NEXT: (if
@@ -269,7 +269,7 @@
)
)
)
- ;; CHECK: (func $leave-inner-block-type
+ ;; CHECK: (func $leave-inner-block-type (type $0)
;; CHECK-NEXT: (block $label$1
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block $label$2
@@ -312,7 +312,7 @@
(memory $0 1 1 shared)
;; CHECK: (export "func_2224" (func $0))
(export "func_2224" (func $0))
- ;; CHECK: (func $0 (result i32)
+ ;; CHECK: (func $0 (type $0) (result i32)
;; CHECK-NEXT: (local $var$0 i32)
;; CHECK-NEXT: (if (result i32)
;; CHECK-NEXT: (i32.const 0)
@@ -352,7 +352,7 @@
;; CHECK: (global $global$0 (mut i32) (i32.const 10))
(global $global$0 (mut i32) (i32.const 10))
- ;; CHECK: (func $determinism
+ ;; CHECK: (func $determinism (type $0)
;; CHECK-NEXT: (block $folding-inner0
;; CHECK-NEXT: (block
;; CHECK-NEXT: (block $label$1
@@ -439,7 +439,7 @@
)
(unreachable)
)
- ;; CHECK: (func $careful-of-the-switch (param $0 i32)
+ ;; CHECK: (func $careful-of-the-switch (type $1) (param $0 i32)
;; CHECK-NEXT: (block $label$1
;; CHECK-NEXT: (block $label$3
;; CHECK-NEXT: (block $label$5
@@ -482,3 +482,42 @@
)
)
)
+
+(module
+ ;; CHECK: (type $0 (func))
+
+ ;; CHECK: (func $br-on-null (type $0)
+ ;; CHECK-NEXT: (block $block
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (br_on_null $block
+ ;; CHECK-NEXT: (ref.null none)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (block (result i32)
+ ;; CHECK-NEXT: (call $br-on-null)
+ ;; CHECK-NEXT: (br $block)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $br-on-null)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $br-on-null
+ (block $block
+ (drop
+ ;; The other two tails are the same, but this br_on_null should inhibit code
+ ;; folding.
+ (br_on_null $block
+ (ref.null none)
+ )
+ )
+ (drop
+ (block (result i32)
+ (call $br-on-null)
+ (br $block)
+ )
+ )
+ (call $br-on-null)
+ )
+ )
+)