Skip to content

Commit a3ac0eb

Browse files
committed
Update tests
1 parent ccefc7a commit a3ac0eb

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

test/ruby/test_zjit.rb

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -652,13 +652,6 @@ def entry = jit_frame1 # 3
652652
}, call_threshold: 2
653653
end
654654

655-
# We need to support either setconstant or defineclass insns to support ConstBase's
656-
# test case, like
657-
#
658-
# ```
659-
# Foo = 1
660-
# class Module::Bar; end
661-
# ```
662655
def test_putspecialobject_vm_core_and_cbase
663656
assert_compiles '10', %q{
664657
def test
@@ -671,6 +664,20 @@ def test
671664
}, insns: [:putspecialobject]
672665
end
673666

667+
def test_putspecialobject_const_base
668+
assert_compiles '1', %q{
669+
Foo = 1
670+
671+
def test = Foo
672+
673+
# First call: populates the constant cache
674+
test
675+
# Second call: triggers ZJIT compilation with warm cache
676+
# RubyVM::ZJIT.assert_compiles will panic if this fails to compile
677+
test
678+
}, call_threshold: 2
679+
end
680+
674681
# tool/ruby_vm/views/*.erb relies on the zjit instructions a) being contiguous and
675682
# b) being reliably ordered after all the other instructions.
676683
def test_instruction_order

0 commit comments

Comments
 (0)