summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_zjit.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index 52f2cddeb7..736c6306d1 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -139,6 +139,20 @@ class TestZJIT < Test::Unit::TestCase
}, insns: [:splatarray]
end
+ def test_definedivar
+ assert_compiles '[nil, "instance-variable", nil]', %q{
+ def test
+ v0 = defined?(@a)
+ @a = nil
+ v1 = defined?(@a)
+ remove_instance_variable :@a
+ v2 = defined?(@a)
+ [v0, v1, v2]
+ end
+ test
+ }, insns: [:definedivar]
+ end
+
def test_setglobal_with_trace_var_exception
assert_compiles '"rescued"', %q{
def test