summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2021-06-10 09:40:30 -0700
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:36 -0400
commit9043ad3d74413823e62b11923652d272e41dc230 (patch)
treed11210a1f2cdf3958ee2ea66d2cf32b6db77597c /bootstraptest
parent986b9b47d11829f1071f7d3bab78f847ea4543bf (diff)
Implement topn instruction
This commit implements the topn instruction Co-Authored-By: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> Co-Authored-By: Noah Gibbs <noah.gibbs@shopify.com>
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_yjit.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index 51c82b55b5..fcf027d728 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -1,3 +1,21 @@
+# Test for topn
+assert_equal 'array', %q{
+ def threequals(a)
+ case a
+ when Array
+ "array"
+ when Hash
+ "hash"
+ else
+ "unknown"
+ end
+ end
+
+ threequals([])
+ threequals([])
+ threequals([])
+}
+
# Test for opt_mod
assert_equal '2', %q{
def mod(a, b)