Skip to content

Commit

Permalink
Port gen_send_cfunc to the new backend (#357)
Browse files Browse the repository at this point in the history
* Port gen_send_cfunc to the new backend

* Remove an obsoleted test

* Add more cfunc tests

* Use csel_e instead and more into()

Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>

* Add a missing lea for build_kwargs

* Split cfunc test cases

Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
  • Loading branch information
k0kubun and maximecb committed Aug 26, 2022
1 parent 4540b30 commit 370a9ae
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 91 deletions.
32 changes: 32 additions & 0 deletions bootstraptest/test_yjit_new_backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,38 @@ def foo()
foo()
}

# opt_send_without_block (VM_METHOD_TYPE_CFUNC)
assert_equal 'nil', %q{
def foo
nil.inspect # argc: 0
end
foo
}
assert_equal '4', %q{
def foo
2.pow(2) # argc: 1
end
foo
}
assert_equal 'aba', %q{
def foo
"abc".tr("c", "a") # argc: 2
end
foo
}
assert_equal 'true', %q{
def foo
respond_to?(:inspect) # argc: -1
end
foo
}
assert_equal '["a", "b"]', %q{
def foo
"a\nb".lines(chomp: true) # kwargs
end
foo
}

# opt_send_without_block (VM_METHOD_TYPE_ATTRSET)
assert_equal 'foo', %q{
class Foo
Expand Down
Loading

0 comments on commit 370a9ae

Please sign in to comment.