diff options
author | John Hawthorn <john@hawthorn.email> | 2022-01-05 01:07:52 -0800 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2022-01-08 11:40:55 -0800 |
commit | 18b97eee5ace0fc70bf4e6d61092ad9fbade5f56 (patch) | |
tree | c4f14fbf3d514a78499caaf007bd2dd7b8bc652b /bootstraptest | |
parent | b5c039125fe375f91b9795a5e1b29febaa12d072 (diff) |
YJIT: Add support for ruby array cfuncs (argc=-2)
This adds support for cfuncs which take variable arguments using a Ruby
array. This is specified with the method entry's argc == -2.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5396
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_yjit.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 47744efb73..a52ed8027d 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -2766,3 +2766,23 @@ assert_equal 'ok', %q{ foo(s) rescue :ok foo(s) rescue :ok } + +# File.join is a cfunc accepting variable arguments as a Ruby array (argc = -2) +assert_equal 'foo/bar', %q{ + def foo + File.join("foo", "bar") + end + + foo + foo +} + +# File.join is a cfunc accepting variable arguments as a Ruby array (argc = -2) +assert_equal '', %q{ + def foo + File.join() + end + + foo + foo +} |