[前][次][番号順一覧][スレッド一覧]

ruby-changes:68748

From: Maxime <ko1@a...>
Date: Thu, 21 Oct 2021 08:13:25 +0900 (JST)
Subject: [ruby-changes:68748] a8827e5c5f (master): Added failing test to `make btest`

https://git.ruby-lang.org/ruby.git/commit/?id=a8827e5c5f

From a8827e5c5fb1e3218e7f0d5ac792482c0d65f8f3 Mon Sep 17 00:00:00 2001
From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...>
Date: Tue, 9 Feb 2021 17:34:02 -0500
Subject: Added failing test to `make btest`

---
 bootstraptest/test_ujit.rb | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/bootstraptest/test_ujit.rb b/bootstraptest/test_ujit.rb
index dda9e89559..13cb81d368 100644
--- a/bootstraptest/test_ujit.rb
+++ b/bootstraptest/test_ujit.rb
@@ -43,6 +43,34 @@ assert_equal '6', %q{ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_ujit.rb#L43
     retval = foo()
 }
 
+# foo leaves a temp on the stack before the call
+assert_equal '0', %q{
+    def bar(a, b)
+        return a - b
+    end
+
+    def foo
+        return 1 + bar(1, 2)
+    end
+
+    foo()
+    retval = foo()
+}
+
+# Recursive Ruby-to-Ruby calls
+assert_equal '21', %q{
+
+    def fib(n)
+        if n < 2
+            return n
+        end
+
+        return fib(n-1) + fib(n-2)
+    end
+
+    r = fib(8)
+}
+
 # Ruby-to-Ruby call and C call
 assert_normal_exit %q{
   def bar
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]