Skip to content

Commit

Permalink
Update compile.js
Browse files Browse the repository at this point in the history
  • Loading branch information
dy committed Dec 12, 2024
1 parent 0a657e5 commit 6e16066
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1010,13 +1010,16 @@ t('case: double inline block', () => {
run(src)
})

t('case: inline if', () => {
t.skip('case: inline if', () => {
// FIXME: wabt compiles that only accidentally, it's not part of standard
// and that doesn't work in repl https://webassembly.github.io/wabt/demo/wat2wasm/

// equiv to (if (result x) a (then b))
let src2 = `(func (if (result i32) (i32.const 1) (i32.const 2)))`
is(compile(parse(src2)), wat2wasm(src2).buffer)

// equiv to (if (result x) a (then b)(else c))
let src = `(func (if (result i32) (i32.const 1) (i32.const 2) (i32.const 3)))`
let src = `(func (if (result i64) (i64.const 7) (i64.const 8) (i64.const 9)))`
is(compile(parse(src)), wat2wasm(src).buffer)
})

Expand Down Expand Up @@ -1159,8 +1162,10 @@ t('feature: multiple results', () => {
let src4 = `(func (if (result i32 i32) (i32.const 0) (then (i32.const 1)(i32.const 2))))`
is(compile(parse(src4)), wat2wasm(src4).buffer)

let src5 = `(func (if (result i32 i32 i32) (i32.const 0)(i32.const 1)(i32.const 2)))`
is(compile(parse(src5)), wat2wasm(src5).buffer)
// FIXME: I think else is optional at the end https://webassembly.github.io/spec/core/text/instructions.html#abbreviations which wabt doesn't do
// must be an error in wabt
// let src5 = `(func (if (result i32 i32 i32) (i32.const 0)(i32.const 1)(i32.const 2)))`
// is(compile(parse(src5)), wat2wasm(src5).buffer)
})

t('feature: bulk memory', () => {
Expand Down

0 comments on commit 6e16066

Please sign in to comment.