diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_zjit.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb index d6fc4ba2f7..d4f53dcb5b 100644 --- a/test/ruby/test_zjit.rb +++ b/test/ruby/test_zjit.rb @@ -545,6 +545,20 @@ class TestZJIT < Test::Unit::TestCase } end + def test_getinstancevariable + assert_compiles 'nil', %q{ + def test() = @foo + + test() + } + assert_compiles '3', %q{ + @foo = 3 + def test() = @foo + + test() + } + end + # tool/ruby_vm/views/*.erb relies on the zjit instructions a) being contiguous and # b) being reliably ordered after all the other instructions. def test_instruction_order |