summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_yjit.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb
index 9ad59bc962..88be6622ce 100644
--- a/test/ruby/test_yjit.rb
+++ b/test/ruby/test_yjit.rb
@@ -1,4 +1,8 @@
# frozen_string_literal: true
+#
+# This set of tests can be run with:
+# make test-all TESTS='test/ruby/test_yjit.rb' RUN_OPTS="--yjit-call-threshold=1"
+
require 'test/unit'
require 'envutil'
require 'tmpdir'
@@ -453,6 +457,27 @@ class TestYJIT < Test::Unit::TestCase
RUBY
end
+ def test_getivar_opt_plus
+ assert_no_exits(<<~RUBY)
+ class TheClass
+ def initialize
+ @levar = 1
+ end
+
+ def get_sum
+ sum = 0
+ # The type of levar is unknown,
+ # but this still should not exit
+ sum += @levar
+ sum
+ end
+ end
+
+ obj = TheClass.new
+ obj.get_sum
+ RUBY
+ end
+
def test_super_iseq
assert_compiles(<<~'RUBY', insns: %i[invokesuper opt_plus opt_mult], result: 15)
class A