diff options
author | John Hawthorn <john@hawthorn.email> | 2021-06-24 08:15:53 -0700 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:37 -0400 |
commit | 9e0a56fb24ed741d2215a4c4f7e560fa7b88dc8b (patch) | |
tree | 522413297de63a5c5a57a4c35460213ac3efb098 /bootstraptest | |
parent | dfc5e5e35b927bcfc26af0b59d4952e97bdfb0f7 (diff) |
Add FLONUM detection
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_yjit.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index db494b7911..4bf9bc4262 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -1347,3 +1347,22 @@ assert_equal 'bar', %q{ to_string((-"bar").to_sym) to_string((-"bar").to_sym) } + +# Call to flonum and heap float +assert_equal '[nil, nil, nil, 1]', %q{ + def is_inf(obj) + obj.infinite? + end + + is_inf(0.0) + is_inf(0.0) + is_inf(1e256) + is_inf(1e256) + + [ + is_inf(0.0), + is_inf(1.0), + is_inf(1e256), + is_inf(1.0/0.0) + ] +} |