Skip to content

Not enough unreachability/side-effects tests #1644

Open
@SoniEx2

Description

@SoniEx2

While a real compiler should never emit code like

(module
  (global $a (mut i32) (i32.const 0))

  (func (export "get-a") (result i32) (global.get $a))

  (func $set-and-return-a (result i32) (global.set $a (i32.const 1)) (global.get $a))

  (func (export "call-unreachable") (result i32)
    (call $set-and-return-a)
    (unreachable)
  )
)

(assert_trap (invoke "call-unreachable") "unreachable")
(assert_return (invoke "get-a") (i32.const 1))

it would be nice to see more tests like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions