ruby-changes:68830
From: Maxime <ko1@a...>
Date: Thu, 21 Oct 2021 08:14:07 +0900 (JST)
Subject: [ruby-changes:68830] d6d58795a9 (master): Rename test files
https://git.ruby-lang.org/ruby.git/commit/?id=d6d58795a9 From d6d58795a90d338ac8fb308c8a79044172778485 Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...> Date: Thu, 4 Mar 2021 15:16:33 -0500 Subject: Rename test files --- bootstraptest/test_ujit.rb | 246 - bootstraptest/test_ujit_30k_ifelse.rb | 241023 ------------------------------ bootstraptest/test_ujit_30k_methods.rb | 121018 --------------- bootstraptest/test_yjit.rb | 246 + bootstraptest/test_yjit_30k_ifelse.rb | 241023 ++++++++++++++++++++++++++++++ bootstraptest/test_yjit_30k_methods.rb | 121018 +++++++++++++++ 6 files changed, 362287 insertions(+), 362287 deletions(-) delete mode 100644 bootstraptest/test_ujit.rb delete mode 100644 bootstraptest/test_ujit_30k_ifelse.rb delete mode 100644 bootstraptest/test_ujit_30k_methods.rb create mode 100644 bootstraptest/test_yjit.rb create mode 100644 bootstraptest/test_yjit_30k_ifelse.rb create mode 100644 bootstraptest/test_yjit_30k_methods.rb diff --git a/bootstraptest/test_ujit.rb b/bootstraptest/test_ujit.rb deleted file mode 100644 index 0f67c6ebbb..0000000000 --- a/bootstraptest/test_ujit.rb +++ /dev/null @@ -1,246 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/#L0 -# Putobject, less-than operator, fixnums -assert_equal '2', %q{ - def check_index(index) - if 0x40000000 < index - raise "wat? #{index}" - end - index - end - check_index 2 - check_index 2 -} - -# foo leaves a temp on the stack before the call -assert_equal '6', %q{ - def bar - return 5 - end - - def foo - return 1 + bar - end - - foo() - retval = foo() -} - -# Method with one arguments -# foo leaves a temp on the stack before the call -assert_equal '7', %q{ - def bar(a) - return a + 1 - end - - def foo - return 1 + bar(5) - end - - foo() - retval = foo() -} - -# Method with two arguments -# 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 - puts('hi!') - end - - def foo - bar - end - - foo() - foo() -} - -# The hash method is a C function and uses the self argument -assert_equal 'true', %q{ - def lehashself - hash - end - - a = lehashself - b = lehashself - a == b -} - -# Method redefinition (code invalidation) test -assert_equal '1', %q{ - def ret1 - return 1 - end - - klass = Class.new do - def alias_then_hash(klass, method_to_redefine) - # Redefine the method to be ret1 - klass.alias_method(method_to_redefine, :ret1) - hash - end - end - - instance = klass.new - - i = 0 - while i < 12 - if i < 11 - # Redefine the bar method - instance.alias_then_hash(klass, :bar) - else - # Redefine the hash method to be ret1 - retval = instance.alias_then_hash(klass, :hash) - end - i += 1 - end - - retval -} - -# Method redefinition (code invalidation) and GC -assert_equal '7', %q{ - def bar() - return 5 - end - - def foo() - bar() - end - - foo() - foo() - - def bar() - return 7 - end - - 4.times { GC.start } - - foo() - foo() -} - -# Method redefinition with two block versions -assert_equal '7', %q{ - def bar() - return 5 - end - - def foo(n) - return ((n < 5)? 5:false), bar() - end - - foo(4) - foo(4) - foo(10) - foo(10) - - def bar() - return 7 - end - - 4.times { GC.start } - - foo(4) - foo(4)[1] -} - -# Test for GC safety. Don't invalidate dead iseqs. -assert_normal_exit %q{ - Class.new do - def foo - itself - end - - new.foo - new.foo - new.foo - new.foo - end - - 4.times { GC.start } - def itself - self - end -} - -# Test that getinstancevariable codegen checks for extended table size -assert_equal "nil\n", %q{ - class A - def read - @ins1000 - end - end - - ins = A.new - other = A.new - 10.times { other.instance_variable_set(:"@otr#{_1}", 'value') } - 1001.times { ins.instance_variable_set(:"@ins#{_1}", 'value') } - - ins.read - ins.read - ins.read - - p other.read -} - -# Test that opt_aref checks the class of the receiver -assert_equal 'special', %q{ - def foo(array) - array[30] - end - - foo([]) - foo([]) - - special = [] - def special.[](idx) - 'special' - end - - foo(special) -} - -# Test that object references in generated code get marked and moved -assert_equal "good", %q{ - def bar - "good" - end - - def foo - bar - end - - foo - foo - - GC.verify_compaction_references(double_heap: true, toward: :empty) - - foo -} diff --git a/bootstraptest/test_ujit_30k_ifelse.rb b/bootstraptest/test_ujit_30k_ifelse.rb deleted file mode 100644 index be07b35c98..0000000000 --- a/bootstraptest/test_ujit_30k_ifelse.rb +++ /dev/null @@ -1,241023 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/#L0 -# This is a torture test for the JIT. -# There are 30K tiny methods with if-else statements in a 30-deep call hierarchy. -assert_equal '100000', %q{ - -def fun_l0_n0(x) - if (x < 1) - fun_l1_n310(x) - else - fun_l1_n485(x) - end -end - -def fun_l0_n1(x) - if (x < 1) - fun_l1_n930(x) - else - fun_l1_n418(x) - end -end - -def fun_l0_n2(x) - if (x < 1) - fun_l1_n549(x) - else - fun_l1_n44(x) - end -end - -def fun_l0_n3(x) - if (x < 1) - fun_l1_n394(x) - else - fun_l1_n447(x) - end -end - -def fun_l0_n4(x) - if (x < 1) - fun_l1_n683(x) - else - fun_l1_n547(x) - end -end - -def fun_l0_n5(x) - if (x < 1) - fun_l1_n320(x) - else - fun_l1_n896(x) - end -end - -def fun_l0_n6(x) - if (x < 1) - fun_l1_n649(x) - else - fun_l1_n243(x) - end -end - -def fun_l0_n7(x) - if (x < 1) - fun_l1_n100(x) - else - fun_l1_n243(x) - end -end - -def fun_l0_n8(x) - if (x < 1) - fun_l1_n839(x) - else - fun_l1_n720(x) - end -end - -def fun_l0_n9(x) - if (x < 1) - fun_l1_n177(x) - else - fun_l1_n555(x) - end -end - -def fun_l0_n10(x) - if (x < 1) - fun_l1_n814(x) - else - fun_l1_n900(x) - end -end - -def fun_l0_n11(x) - if (x < 1) - fun_l1_n585(x) - else - fun_l1_n901(x) - end -end - -def fun_l0_n12(x) - if (x < 1) - fun_l1_n952(x) - else - fun_l1_n270(x) - end -end - -def fun_l0_n13(x) - if (x < 1) - fun_l1_n172(x) - else - fun_l1_n209(x) - end -end - -def fun_l0_n14(x) - if (x < 1) - fun_l1_n514(x) - else - fun_l1_n414(x) - end -end - -def fun_l0_n15(x) - if (x < 1) - fun_l1_n190(x) - else - fun_l1_n100(x) - end -end - -def fun_l0_n16(x) - if (x < 1) - fun_l1_n696(x) - else - fun_l1_n997(x) - end -end - -def fun_l0_n17(x) - if (x < 1) - fun_l1_n568(x) - else - fun_l1_n820(x) - end -end - -def fun_l0_n18(x) - if (x < 1) - fun_l1_n837(x) - else - fun_l1_n588(x) - end -end - -def fun_l0_n19(x) - if (x < 1) - fun_l1_n206(x) - else - fun_l1_n126(x) - end -end - -def fun_l0_n20(x) - if (x < 1) - fun_l1_n317(x) - else - fun_l1_n722(x) - end -end - -def fun_l0_n21(x) - if (x < 1) - fun_l1_n614(x) - else - fun_l1_n372(x) - end -end - -def fun_l0_n22(x) - if (x < 1) - fun_l1_n530(x) - else - fun_l1_n862(x) - end -end - -def fun_l0_n23(x) - if (x < 1) - fun_l1_n889(x) - else - fun_l1_n271(x) - end -end - -def fun_l0_n24(x) - if (x < 1) - fun_l1_n996(x) - else - fun_l1_n717(x) - end -end - -def fun_l0_n25(x) - if (x < 1) - fun_l1_n726(x) - else - fun_l1_n939(x) - end -end - -def fun_l0_n26(x) - if (x < 1) - fun_l1_n316(x) - else - fun_l1_n293(x) - end -end - -def fun_l0_n27(x) - if (x < 1) - fun_l1_n90(x) - else - fun_l1_n596(x) - end -end - -def fun_l0_n28(x) - if (x < 1) - fun_l1_n743(x) - else - fun_l1_n782(x) - end -end - -def fun_l0_n29(x) - if (x < 1) - fun_l1_n896(x) - else - fun_l1_n247(x) - end -end - -def fun_l0_n30(x) - if (x < 1) - fun_l1_n2(x) - else - fun_l1_n377(x) - end -end - -def fun_l0_n31(x) - if (x < 1) - fun_l1_n380(x) - else - fun_l1_n655(x) - end -end - -def fun_l0_n32(x) - if (x < 1) - fun_l1_n572(x) - else - fun_l1_n778(x) - end -end - -def fun_l0_n33(x) - if (x < 1) - fun_l1_n485(x) - else - fun_l1_n282(x) - end -end - -def fun_l0_n34(x) - if (x < 1) - fun_l1_n703(x) - else - fun_l1_n179(x) - end -end - -def fun_l0_n35(x) - if (x < 1) - fun_l1_n281(x) - else - fun_l1_n572(x) - end -end - -def fun_l0_n36(x) - if (x < 1) - fun_l1_n48(x) - else - fun_l1_n286(x) - end -end - -def fun_l0_n37(x) - if (x < 1) - fun_l1_n539(x) - else - fun_l1_n86(x) - end -end - -def fun_l0_n38(x) - if (x < 1) - fun_l1_n918(x) - else - fun_l1_n778(x) - end -end - -def fun_l0_n39(x) - if (x < 1) - fun_l1_n832(x) - else - fun_l1_n94(x) - end -end - -def fun_l0_n40(x) - if (x < 1) - fun_l1_n213(x) - else - fun_l1_n580(x) - end -end - -def fun_l0_n41( (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/