Skip to content

Commit 567d6ff

Browse files
Add a smoke test for constant slot optimization
1 parent 8d5ac75 commit 567d6ff

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(module
2+
(func (export "check") (param i32) (result i32)
3+
;; Enough to reach the limit of constant slots
4+
(drop (i32.const 1))
5+
(drop (i32.const 2))
6+
(drop (i32.const 3))
7+
(drop (i32.const 4))
8+
(drop (i32.const 5))
9+
(drop (i32.const 6))
10+
(i32.add (local.get 0) (i32.add (i32.const 1) (i32.const 1)))
11+
)
12+
)
13+
14+
(assert_return (invoke "check" (i32.const 3)) (i32.const 5))
15+

0 commit comments

Comments
 (0)