ruby-changes:56749
From: Takashi <ko1@a...>
Date: Thu, 1 Aug 2019 19:43:27 +0900 (JST)
Subject: [ruby-changes:56749] Takashi Kokubun: cb84824481 (master): Add a test for opt_nil_p
https://git.ruby-lang.org/ruby.git/commit/?id=cb84824481 From cb84824481f205d5c057fe2e31776d40a6b06c7c Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Thu, 1 Aug 2019 19:42:48 +0900 Subject: Add a test for opt_nil_p diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index 727043f..24ab7fc 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -43,7 +43,7 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L43 if $VERBOSE && !defined?(@@at_exit_hooked) at_exit do unless TestJIT.untested_insns.empty? - warn "untested insns are found!: #{TestJIT.untested_insns.join(' ')}" + warn "you may want to add tests for following insns, when you have a chance: #{TestJIT.untested_insns.join(' ')}" end end @@at_exit_hooked = true @@ -365,6 +365,13 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L365 end; end + def test_compile_insn_opt_nil_p + assert_compile_once("#{<<~"begin;"}\n#{<<~"end;"}", result_inspect: 'false', insns: %i[opt_nil_p]) + begin; + nil.nil?.nil? + end; + end + def test_compile_insn_opt_str_uminus assert_compile_once("#{<<~"begin;"}\n#{<<~"end;"}", result_inspect: '"bar"', insns: %i[opt_str_uminus]) begin; -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/