summaryrefslogtreecommitdiff
path: root/bootstraptest/test_yjit.rb
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2021-06-08 07:52:57 -0700
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:35 -0400
commit67c2cdc59a5fc8a82804c72a30a2d23ba36f2366 (patch)
tree902dab23e1a473a4d931419e9c151a676d01891e /bootstraptest/test_yjit.rb
parent5432f46f6a7a35a8d2a924eae7b1e29289a58292 (diff)
Implement gen_getlocal
This extracts the generation code from getlocal_wc1, since this is the same just with more loops inside vm_get_ep.
Diffstat (limited to 'bootstraptest/test_yjit.rb')
-rw-r--r--bootstraptest/test_yjit.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index 5bf415889e..51c82b55b5 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -1021,3 +1021,17 @@ assert_equal 'foo123', %q{
make_str("foo", 123)
make_str("foo", 123)
}
+
+# getlocal with 2 levels
+assert_equal '7', %q{
+ def foo(foo, bar)
+ while foo > 0
+ while bar > 0
+ return foo + bar
+ end
+ end
+ end
+
+ foo(5,2)
+ foo(5,2)
+}