summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_zjit.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index 98f747c4d0..8e450458dd 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -1162,6 +1162,36 @@ class TestZJIT < Test::Unit::TestCase
}
end
+ def test_getinstancevariable_miss
+ assert_compiles '[1, 1, 4]', %q{
+ class C
+ def foo
+ @foo
+ end
+
+ def foo_then_bar
+ @foo = 1
+ @bar = 2
+ end
+
+ def bar_then_foo
+ @bar = 3
+ @foo = 4
+ end
+ end
+
+ o1 = C.new
+ o1.foo_then_bar
+ result = []
+ result << o1.foo
+ result << o1.foo
+ o2 = C.new
+ o2.bar_then_foo
+ result << o2.foo
+ result
+ }
+ end
+
def test_setinstancevariable
assert_compiles '1', %q{
def test() = @foo = 1