summaryrefslogtreecommitdiff
path: root/test/ruby/test_zjit.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2025-09-05 11:26:01 -0700
committerGitHub <noreply@github.com>2025-09-05 11:26:01 -0700
commit4f030951f28aad7080d8b60a28148ec0b3636d58 (patch)
tree9e12f7d557854238ad7a94ee27f7e5cd8afaff61 /test/ruby/test_zjit.rb
parentce20d68dae210aab2df8078014a563530321e7db (diff)
ZJIT: Invalidate local variables on EP escape (#14448)
Diffstat (limited to 'test/ruby/test_zjit.rb')
-rw-r--r--test/ruby/test_zjit.rb47
1 files changed, 45 insertions, 2 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index f430ff8c44..2f19708466 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -196,6 +196,50 @@ class TestZJIT < Test::Unit::TestCase
}, insns: [:setglobal]
end
+ def test_getlocal_after_eval
+ assert_compiles '2', %q{
+ def test
+ a = 1
+ eval('a = 2')
+ a
+ end
+ test
+ }
+ end
+
+ def test_getlocal_after_instance_eval
+ assert_compiles '2', %q{
+ def test
+ a = 1
+ instance_eval('a = 2')
+ a
+ end
+ test
+ }
+ end
+
+ def test_getlocal_after_module_eval
+ assert_compiles '2', %q{
+ def test
+ a = 1
+ Kernel.module_eval('a = 2')
+ a
+ end
+ test
+ }
+ end
+
+ def test_getlocal_after_class_eval
+ assert_compiles '2', %q{
+ def test
+ a = 1
+ Kernel.class_eval('a = 2')
+ a
+ end
+ test
+ }
+ end
+
def test_setlocal
assert_compiles '3', %q{
def test(n)
@@ -1453,8 +1497,7 @@ class TestZJIT < Test::Unit::TestCase
end
def test_bop_invalidation
- omit 'Invalidation on BOP redefinition is not implemented yet'
- assert_compiles '', %q{
+ assert_compiles '100', %q{
def test
eval(<<~RUBY)
class Integer