Skip to content

Commit 4d07c73

Browse files
authored
[NFC] Port old precompute* tests to lit (#7867)
1 parent 9de4aca commit 4d07c73

9 files changed

+1400
-1372
lines changed

test/lit/passes/precompute-propagate_all-features.wast

Lines changed: 567 additions & 0 deletions
Large diffs are not rendered by default.

test/lit/passes/precompute_all-features.wast

Lines changed: 801 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
2+
;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up.
3+
4+
;; RUN: foreach %s %t wasm-opt --precompute --coalesce-locals --vacuum -S -o - | filecheck %s
5+
6+
(module
7+
;; CHECK: (type $0 (func (param i32) (result i32)))
8+
9+
;; CHECK: (func $nested-br_if-value (param $0 i32) (result i32)
10+
;; CHECK-NEXT: (loop $label$0
11+
;; CHECK-NEXT: (br $label$0)
12+
;; CHECK-NEXT: )
13+
;; CHECK-NEXT: )
14+
(func $nested-br_if-value (param $var$0 i32) (result i32)
15+
(local $1 i32)
16+
(local $2 i32)
17+
(loop $label$0 (result i32)
18+
(drop
19+
(i32.const 2)
20+
)
21+
(block (result i32)
22+
(local.set $2
23+
(i32.const 4)
24+
)
25+
(br_if $label$0 ;; precomputing this into a br must change the type
26+
(i32.const 1)
27+
)
28+
(local.get $2)
29+
)
30+
)
31+
)
32+
)

test/passes/precompute-propagate_all-features.txt

Lines changed: 0 additions & 322 deletions
This file was deleted.

0 commit comments

Comments
 (0)