Skip to content

Commit

Permalink
[test] Add tests for out-of-range NaN payloads (#1670)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Jul 11, 2023
1 parent 5b18d52 commit 2b00952
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/core/float_literals.wast
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@
(module quote "(global f32 (f32.const 0x1.0p_+1))")
"unknown operator"
)
(assert_malformed
(module quote "(global f32 (f32.const nan:0x80_0000))")
"constant out of range"
)

(assert_malformed
(module quote "(global f64 (f64.const _100))")
Expand Down Expand Up @@ -505,3 +509,7 @@
(module quote "(global f64 (f64.const 0x1.0p_+1))")
"unknown operator"
)
(assert_malformed
(module quote "(global f64 (f64.const nan:0x10_0000_0000_0000))")
"constant out of range"
)

0 comments on commit 2b00952

Please sign in to comment.