summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorDaniel Colson <danieljamescolson@gmail.com>2025-08-19 10:02:13 -0400
committerGitHub <noreply@github.com>2025-08-19 10:02:13 -0400
commitfc5ee247d5307a292cd2b083ce82fc24005bb385 (patch)
treed3d6e0514685e9d258167d203f07bbbeddb87475 /test/ruby
parent6281806fc6dee87ec39a545ce0a157d740446674 (diff)
ZJIT: Compile toregexp (#14200)
`toregexp` is fairly similar to `concatstrings`, so this commit extracts a helper for pushing and popping operands on the native stack. There's probably opportunity to move some of this into lir (e.g. Alan suggested a push_many that could use STP on ARM to push 2 at a time), but I might save that for another day.
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_zjit.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index 96ac99b6db..e18333a58f 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -1847,6 +1847,14 @@ class TestZJIT < Test::Unit::TestCase
}, insns: [:concatstrings]
end
+ def test_regexp_interpolation
+ assert_compiles '/123/', %q{
+ def test = /#{1}#{2}#{3}/
+
+ test
+ }, insns: [:toregexp]
+ end
+
private
# Assert that every method call in `test_script` can be compiled by ZJIT